# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys
from typing import List
from alibabacloud_dingtalk.calendar_1_0.client import Client as dingtalkcalendar_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.calendar_1_0 import models as dingtalkcalendar__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
class Sample:
def __init__(self):
pass
@staticmethod
def create_client() -> dingtalkcalendar_1_0Client:
"""
Initialize the account Client with a Token
@return: Client
@throws Exception
"""
config = open_api_models.Config()
config.protocol = 'https'
config.region_id = 'central'
return dingtalkcalendar_1_0Client(config)
@staticmethod
def main(
args: List[str],
) -> None:
client = Sample.create_client()
remove_attendee_headers = dingtalkcalendar__1__0_models.RemoveAttendeeHeaders()
remove_attendee_headers.x_acs_dingtalk_access_token = '<your access token>'
attendees_to_remove_0 = dingtalkcalendar__1__0_models.RemoveAttendeeRequestAttendeesToRemove(
id='iiiP35sJadba8aBSgjrwPRKgiEiF'
)
remove_attendee_request = dingtalkcalendar__1__0_models.RemoveAttendeeRequest(
attendees_to_remove=[
attendees_to_remove_0
]
)
try:
client.remove_attendee_with_options('iiiP35sJadba8aBSgjrwPRKgiEiF', 'primary', 'cnNTbW1YbU9sL2p6aFJZdEgvdlQrQT09', remove_attendee_request, remove_attendee_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err contains the code and message properties, which help locate issues
pass
@staticmethod
async def main_async(
args: List[str],
) -> None:
client = Sample.create_client()
remove_attendee_headers = dingtalkcalendar__1__0_models.RemoveAttendeeHeaders()
remove_attendee_headers.x_acs_dingtalk_access_token = '<your access token>'
attendees_to_remove_0 = dingtalkcalendar__1__0_models.RemoveAttendeeRequestAttendeesToRemove(
id='iiiP35sJadba8aBSgjrwPRKgiEiF'
)
remove_attendee_request = dingtalkcalendar__1__0_models.RemoveAttendeeRequest(
attendees_to_remove=[
attendees_to_remove_0
]
)
try:
await client.remove_attendee_with_options_async('iiiP35sJadba8aBSgjrwPRKgiEiF', 'primary', 'cnNTbW1YbU9sL2p6aFJZdEgvdlQrQT09', remove_attendee_request, remove_attendee_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err contains the code and message properties, which help locate issues
pass
if __name__ == '__main__':
Sample.main(sys.argv[1:])