Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated models and request builders #564

Merged
merged 9 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install flit
python-version: '3.12'
- name: Install dependencies
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

release:
name: Create release
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2024-01-11
## [1.1.0] - 2024-01-24

### Added

### Changed
- Latest metadata updates from 9th January 2024.
- Latest metadata updates from 23rd January 2024.

## [1.0.0] - 2023-10-31

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union

if TYPE_CHECKING:
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

@dataclass
class SecretsPutRequestBody(AdditionalDataHolder, BackedModel, Parsable):
# Stores model information.
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)

# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additional_data: Dict[str, Any] = field(default_factory=dict)
# The value property
value: Optional[List[SynchronizationSecretKeyStringValuePair]] = None

@staticmethod
def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> SecretsPutRequestBody:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: SecretsPutRequestBody
"""
if not parse_node:
raise TypeError("parse_node cannot be null.")
return SecretsPutRequestBody()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

fields: Dict[str, Callable[[Any], None]] = {
"value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(SynchronizationSecretKeyStringValuePair)),
}
return fields

def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if not writer:
raise TypeError("writer cannot be null.")
writer.write_collection_of_object_values("value", self.value)
writer.write_additional_data_value(self.additional_data)


Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING, Union

if TYPE_CHECKING:
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

@dataclass
class SecretsPutResponse(AdditionalDataHolder, BackedModel, Parsable):
# Stores model information.
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)

# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
additional_data: Dict[str, Any] = field(default_factory=dict)
# The value property
value: Optional[List[SynchronizationSecretKeyStringValuePair]] = None

@staticmethod
def create_from_discriminator_value(parse_node: Optional[ParseNode] = None) -> SecretsPutResponse:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: SecretsPutResponse
"""
if not parse_node:
raise TypeError("parse_node cannot be null.")
return SecretsPutResponse()

def get_field_deserializers(self,) -> Dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: Dict[str, Callable[[ParseNode], None]]
"""
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair

fields: Dict[str, Callable[[Any], None]] = {
"value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(SynchronizationSecretKeyStringValuePair)),
}
return fields

def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if not writer:
raise TypeError("writer cannot be null.")
writer.write_collection_of_object_values("value", self.value)
writer.write_additional_data_value(self.additional_data)


Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

if TYPE_CHECKING:
from .....models.o_data_errors.o_data_error import ODataError
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair
from .count.count_request_builder import CountRequestBuilder
from .secrets_put_request_body import SecretsPutRequestBody
from .secrets_put_response import SecretsPutResponse

class SecretsRequestBuilder(BaseRequestBuilder):
"""
Expand All @@ -27,12 +28,12 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Optional[Uni
"""
super().__init__(request_adapter, "{+baseurl}/applications/{application%2Did}/synchronization/secrets", path_parameters)

async def put(self,body: Optional[List[SynchronizationSecretKeyStringValuePair]] = None, request_configuration: Optional[SecretsRequestBuilderPutRequestConfiguration] = None) -> Optional[List[SynchronizationSecretKeyStringValuePair]]:
async def put(self,body: Optional[SecretsPutRequestBody] = None, request_configuration: Optional[SecretsRequestBuilderPutRequestConfiguration] = None) -> Optional[SecretsPutResponse]:
"""
Update property secrets value.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[List[SynchronizationSecretKeyStringValuePair]]
Returns: Optional[SecretsPutResponse]
"""
if not body:
raise TypeError("body cannot be null.")
Expand All @@ -47,11 +48,11 @@ async def put(self,body: Optional[List[SynchronizationSecretKeyStringValuePair]]
}
if not self.request_adapter:
raise Exception("Http core is null")
from .....models.synchronization_secret_key_string_value_pair import SynchronizationSecretKeyStringValuePair
from .secrets_put_response import SecretsPutResponse

return await self.request_adapter.send_collection_async(request_info, SynchronizationSecretKeyStringValuePair, error_mapping)
return await self.request_adapter.send_async(request_info, SecretsPutResponse, error_mapping)

def to_put_request_information(self,body: Optional[List[SynchronizationSecretKeyStringValuePair]] = None, request_configuration: Optional[SecretsRequestBuilderPutRequestConfiguration] = None) -> RequestInformation:
def to_put_request_information(self,body: Optional[SecretsPutRequestBody] = None, request_configuration: Optional[SecretsRequestBuilderPutRequestConfiguration] = None) -> RequestInformation:
"""
Update property secrets value.
param body: The request body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ async def delete(self,request_configuration: Optional[ConversationMemberItemRequ

async def get(self,request_configuration: Optional[ConversationMemberItemRequestBuilderGetRequestConfiguration] = None) -> Optional[ConversationMember]:
"""
Retrieve a conversationMember from a chat.
Retrieve a conversationMember from a chat or channel.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ConversationMember]
Find more info here: https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -110,7 +110,7 @@ def to_delete_request_information(self,request_configuration: Optional[Conversat

def to_get_request_information(self,request_configuration: Optional[ConversationMemberItemRequestBuilderGetRequestConfiguration] = None) -> RequestInformation:
"""
Retrieve a conversationMember from a chat.
Retrieve a conversationMember from a chat or channel.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -168,7 +168,7 @@ class ConversationMemberItemRequestBuilderDeleteRequestConfiguration(BaseRequest
@dataclass
class ConversationMemberItemRequestBuilderGetQueryParameters():
"""
Retrieve a conversationMember from a chat.
Retrieve a conversationMember from a chat or channel.
"""
def get_query_parameter(self,original_name: Optional[str] = None) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ async def get(self,request_configuration: Optional[RepliesRequestBuilderGetReque

async def post(self,body: Optional[ChatMessage] = None, request_configuration: Optional[RepliesRequestBuilderPostRequestConfiguration] = None) -> Optional[ChatMessage]:
"""
Create a new reply to a chatMessage in a specified channel.
Send a new reply to a chatMessage in a specified channel.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ChatMessage]
Find more info here: https://learn.microsoft.com/graph/api/channel-post-messagereply?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/chatmessage-post-replies?view=graph-rest-1.0
"""
if not body:
raise TypeError("body cannot be null.")
Expand Down Expand Up @@ -110,7 +110,7 @@ def to_get_request_information(self,request_configuration: Optional[RepliesReque

def to_post_request_information(self,body: Optional[ChatMessage] = None, request_configuration: Optional[RepliesRequestBuilderPostRequestConfiguration] = None) -> RequestInformation:
"""
Create a new reply to a chatMessage in a specified channel.
Send a new reply to a chatMessage in a specified channel.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Optional[Uni

async def post(self,body: Optional[InvitePostRequestBody] = None, request_configuration: Optional[InviteRequestBuilderPostRequestConfiguration] = None) -> Optional[InviteParticipantsOperation]:
"""
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[InviteParticipantsOperation]
Find more info here: https://learn.microsoft.com/graph/api/participant-invite?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/participant-delete?view=graph-rest-1.0
"""
if not body:
raise TypeError("body cannot be null.")
Expand All @@ -54,7 +54,7 @@ async def post(self,body: Optional[InvitePostRequestBody] = None, request_config

def to_post_request_information(self,body: Optional[InvitePostRequestBody] = None, request_configuration: Optional[InviteRequestBuilderPostRequestConfiguration] = None) -> RequestInformation:
"""
Invite participants to the active call. For more information about how to handle operations, see commsOperation.
Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def get(self,request_configuration: Optional[DeviceAppManagementRequestBui
Read properties and relationships of the deviceAppManagement object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[DeviceAppManagement]
Find more info here: https://learn.microsoft.com/graph/api/intune-onboarding-deviceappmanagement-get?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-apps-deviceappmanagement-get?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand All @@ -69,7 +69,7 @@ async def patch(self,body: Optional[DeviceAppManagement] = None, request_configu
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[DeviceAppManagement]
Find more info here: https://learn.microsoft.com/graph/api/intune-policyset-deviceappmanagement-update?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-unlock-deviceappmanagement-update?view=graph-rest-1.0
"""
if not body:
raise TypeError("body cannot be null.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ async def delete(self,request_configuration: Optional[ManagedAppPolicyItemReques

async def get(self,request_configuration: Optional[ManagedAppPolicyItemRequestBuilderGetRequestConfiguration] = None) -> Optional[ManagedAppPolicy]:
"""
Read properties and relationships of the managedAppConfiguration object.
Read properties and relationships of the managedAppProtection object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: Optional[ManagedAppPolicy]
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-managedappconfiguration-get?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-get?view=graph-rest-1.0
"""
request_info = self.to_get_request_information(
request_configuration
Expand Down Expand Up @@ -110,7 +110,7 @@ def to_delete_request_information(self,request_configuration: Optional[ManagedAp

def to_get_request_information(self,request_configuration: Optional[ManagedAppPolicyItemRequestBuilderGetRequestConfiguration] = None) -> RequestInformation:
"""
Read properties and relationships of the managedAppConfiguration object.
Read properties and relationships of the managedAppProtection object.
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: RequestInformation
"""
Expand Down Expand Up @@ -177,7 +177,7 @@ class ManagedAppPolicyItemRequestBuilderDeleteRequestConfiguration(BaseRequestCo
@dataclass
class ManagedAppPolicyItemRequestBuilderGetQueryParameters():
"""
Read properties and relationships of the managedAppConfiguration object.
Read properties and relationships of the managedAppProtection object.
"""
def get_query_parameter(self,original_name: Optional[str] = None) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def post(self,body: Optional[TargetAppsPostRequestBody] = None, request_co
param body: The request body
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
Returns: None
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-managedapppolicy-targetapps?view=graph-rest-1.0
Find more info here: https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-targetapps?view=graph-rest-1.0
"""
if not body:
raise TypeError("body cannot be null.")
Expand Down
Loading