|
| 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.get_artifacts_response import GetArtifactsResponse |
| 18 | + from .......models.o_data_errors.o_data_error import ODataError |
| 19 | + from .get_artifacts_post_request_body import GetArtifactsPostRequestBody |
| 20 | + |
| 21 | +class GetArtifactsRequestBuilder(BaseRequestBuilder): |
| 22 | + """ |
| 23 | + Provides operations to call the getArtifacts method. |
| 24 | + """ |
| 25 | + def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None: |
| 26 | + """ |
| 27 | + Instantiates a new GetArtifactsRequestBuilder and sets the default values. |
| 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 | + Returns: None |
| 31 | + """ |
| 32 | + super().__init__(request_adapter, "{+baseurl}/copilot/communications/realtimeActivityFeed/multiActivitySubscriptions/{multiActivitySubscription%2Did}/getArtifacts", path_parameters) |
| 33 | + |
| 34 | + async def post(self,body: GetArtifactsPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[GetArtifactsResponse]: |
| 35 | + """ |
| 36 | + Invoke action getArtifacts |
| 37 | + param body: The request body |
| 38 | + param request_configuration: Configuration for the request such as headers, query parameters, and middleware options. |
| 39 | + Returns: Optional[GetArtifactsResponse] |
| 40 | + """ |
| 41 | + if body is None: |
| 42 | + raise TypeError("body cannot be null.") |
| 43 | + request_info = self.to_post_request_information( |
| 44 | + body, request_configuration |
| 45 | + ) |
| 46 | + from .......models.o_data_errors.o_data_error import ODataError |
| 47 | + |
| 48 | + error_mapping: dict[str, type[ParsableFactory]] = { |
| 49 | + "XXX": ODataError, |
| 50 | + } |
| 51 | + if not self.request_adapter: |
| 52 | + raise Exception("Http core is null") |
| 53 | + from .......models.get_artifacts_response import GetArtifactsResponse |
| 54 | + |
| 55 | + return await self.request_adapter.send_async(request_info, GetArtifactsResponse, error_mapping) |
| 56 | + |
| 57 | + def to_post_request_information(self,body: GetArtifactsPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation: |
| 58 | + """ |
| 59 | + Invoke action getArtifacts |
| 60 | + param body: The request body |
| 61 | + param request_configuration: Configuration for the request such as headers, query parameters, and middleware options. |
| 62 | + Returns: RequestInformation |
| 63 | + """ |
| 64 | + if body is None: |
| 65 | + raise TypeError("body cannot be null.") |
| 66 | + request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters) |
| 67 | + request_info.configure(request_configuration) |
| 68 | + request_info.headers.try_add("Accept", "application/json") |
| 69 | + request_info.set_content_from_parsable(self.request_adapter, "application/json", body) |
| 70 | + return request_info |
| 71 | + |
| 72 | + def with_url(self,raw_url: str) -> GetArtifactsRequestBuilder: |
| 73 | + """ |
| 74 | + Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 75 | + param raw_url: The raw URL to use for the request builder. |
| 76 | + Returns: GetArtifactsRequestBuilder |
| 77 | + """ |
| 78 | + if raw_url is None: |
| 79 | + raise TypeError("raw_url cannot be null.") |
| 80 | + return GetArtifactsRequestBuilder(self.request_adapter, raw_url) |
| 81 | + |
| 82 | + @dataclass |
| 83 | + class GetArtifactsRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]): |
| 84 | + """ |
| 85 | + Configuration for the request such as headers, query parameters, and middleware options. |
| 86 | + """ |
| 87 | + warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning) |
| 88 | + |
| 89 | + |
0 commit comments