Skip to content

Commit 0a3594b

Browse files
authored
Merge pull request #850 from microsoftgraph/beta/pipelinebuild/189193
Generated beta models and request builders
2 parents 5400995 + 9a0ae1f commit 0a3594b

File tree

164 files changed

+6685
-829
lines changed

Some content is hidden

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

164 files changed

+6685
-829
lines changed

msgraph_beta/generated/admin/people/people_request_builder.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from .name_pronunciation.name_pronunciation_request_builder import NamePronunciationRequestBuilder
2121
from .profile_card_properties.profile_card_properties_request_builder import ProfileCardPropertiesRequestBuilder
2222
from .profile_property_settings.profile_property_settings_request_builder import ProfilePropertySettingsRequestBuilder
23+
from .profile_sources.profile_sources_request_builder import ProfileSourcesRequestBuilder
24+
from .profile_sources_with_source_id.profile_sources_with_source_id_request_builder import ProfileSourcesWithSourceIdRequestBuilder
2325
from .pronouns.pronouns_request_builder import PronounsRequestBuilder
2426

2527
class PeopleRequestBuilder(BaseRequestBuilder):
@@ -97,6 +99,18 @@ async def patch(self,body: PeopleAdminSettings, request_configuration: Optional[
9799

98100
return await self.request_adapter.send_async(request_info, PeopleAdminSettings, error_mapping)
99101

102+
def profile_sources_with_source_id(self,source_id: str) -> ProfileSourcesWithSourceIdRequestBuilder:
103+
"""
104+
Provides operations to manage the profileSources property of the microsoft.graph.peopleAdminSettings entity.
105+
param source_id: Alternate key of profileSource
106+
Returns: ProfileSourcesWithSourceIdRequestBuilder
107+
"""
108+
if source_id is None:
109+
raise TypeError("source_id cannot be null.")
110+
from .profile_sources_with_source_id.profile_sources_with_source_id_request_builder import ProfileSourcesWithSourceIdRequestBuilder
111+
112+
return ProfileSourcesWithSourceIdRequestBuilder(self.request_adapter, self.path_parameters, source_id)
113+
100114
def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
101115
"""
102116
Delete navigation property people for admin
@@ -179,6 +193,15 @@ def profile_property_settings(self) -> ProfilePropertySettingsRequestBuilder:
179193

180194
return ProfilePropertySettingsRequestBuilder(self.request_adapter, self.path_parameters)
181195

196+
@property
197+
def profile_sources(self) -> ProfileSourcesRequestBuilder:
198+
"""
199+
Provides operations to manage the profileSources property of the microsoft.graph.peopleAdminSettings entity.
200+
"""
201+
from .profile_sources.profile_sources_request_builder import ProfileSourcesRequestBuilder
202+
203+
return ProfileSourcesRequestBuilder(self.request_adapter, self.path_parameters)
204+
182205
@property
183206
def pronouns(self) -> PronounsRequestBuilder:
184207
"""
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: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
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-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[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-beta
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+
return request_info
105+
106+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ProfileSourceItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
107+
"""
108+
A collection of profile source settings configured by an administrator in an organization.
109+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
110+
Returns: RequestInformation
111+
"""
112+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
113+
request_info.configure(request_configuration)
114+
request_info.headers.try_add("Accept", "application/json")
115+
return request_info
116+
117+
def to_patch_request_information(self,body: ProfileSource, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
118+
"""
119+
Update the properties of a profileSource object.
120+
param body: The request body
121+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
122+
Returns: RequestInformation
123+
"""
124+
if body is None:
125+
raise TypeError("body cannot be null.")
126+
request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
127+
request_info.configure(request_configuration)
128+
request_info.headers.try_add("Accept", "application/json")
129+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
130+
return request_info
131+
132+
def with_url(self,raw_url: str) -> ProfileSourceItemRequestBuilder:
133+
"""
134+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
135+
param raw_url: The raw URL to use for the request builder.
136+
Returns: ProfileSourceItemRequestBuilder
137+
"""
138+
if raw_url is None:
139+
raise TypeError("raw_url cannot be null.")
140+
return ProfileSourceItemRequestBuilder(self.request_adapter, raw_url)
141+
142+
@dataclass
143+
class ProfileSourceItemRequestBuilderDeleteRequestConfiguration(RequestConfiguration[QueryParameters]):
144+
"""
145+
Configuration for the request such as headers, query parameters, and middleware options.
146+
"""
147+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
148+
149+
@dataclass
150+
class ProfileSourceItemRequestBuilderGetQueryParameters():
151+
"""
152+
A collection of profile source settings configured by an administrator in an organization.
153+
"""
154+
def get_query_parameter(self,original_name: str) -> str:
155+
"""
156+
Maps the query parameters names to their encoded names for the URI template parsing.
157+
param original_name: The original query parameter name in the class.
158+
Returns: str
159+
"""
160+
if original_name is None:
161+
raise TypeError("original_name cannot be null.")
162+
if original_name == "expand":
163+
return "%24expand"
164+
if original_name == "select":
165+
return "%24select"
166+
return original_name
167+
168+
# Expand related entities
169+
expand: Optional[list[str]] = None
170+
171+
# Select properties to be returned
172+
select: Optional[list[str]] = None
173+
174+
175+
@dataclass
176+
class ProfileSourceItemRequestBuilderGetRequestConfiguration(RequestConfiguration[ProfileSourceItemRequestBuilderGetQueryParameters]):
177+
"""
178+
Configuration for the request such as headers, query parameters, and middleware options.
179+
"""
180+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
181+
182+
@dataclass
183+
class ProfileSourceItemRequestBuilderPatchRequestConfiguration(RequestConfiguration[QueryParameters]):
184+
"""
185+
Configuration for the request such as headers, query parameters, and middleware options.
186+
"""
187+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
188+
189+

0 commit comments

Comments
 (0)