/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Teams = new TeamsOperations(this); BaseUri = new System.Uri("https://api.botframework.com"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); }
/// <summary> /// Fetches details related to a team /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='teamId'> /// Team Id /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <TeamDetails> FetchTeamDetailsAsync(this ITeamsOperations operations, string teamId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.FetchTeamDetailsWithHttpMessagesAsync(teamId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Fetches channel list for a given team. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='teamId'> /// Team Id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <returns>The channel list for a given team.</returns> public static async Task <ConversationList> FetchChannelListAsync(this ITeamsOperations operations, string teamId, CancellationToken cancellationToken = default(CancellationToken)) { using (var result = await operations.FetchChannelListWithHttpMessagesAsync(teamId, null, cancellationToken).ConfigureAwait(false)) { return(result.Body); } }
/// <summary> /// Fetches information related to a Teams meeting. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='meetingId'> /// Meeting Id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <returns>The details related to a team.</returns> public static async Task <MeetingInfo> FetchMeetingInfoAsync(this ITeamsOperations operations, string meetingId, CancellationToken cancellationToken = default(CancellationToken)) { if (operations is TeamsOperations teamsOperations) { using var result = await teamsOperations.FetchMeetingInfoWithHttpMessagesAsync(meetingId, null, cancellationToken).ConfigureAwait(false); return(result.Body); } throw new InvalidOperationException("TeamsOperations with GetMeetingInfoWithHttpMessagesAsync is required for FetchMeetingInfoAsync."); }
/// <summary> /// Fetches participant details related to a Teams meeting. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='meetingId'> /// Team meeting Id. /// </param> /// <param name='participantId'> /// Team meeting participant Id. /// </param> /// <param name='tenantId'> /// Team meeting tenant Id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <returns>The participant details related to a Teams meeting.</returns> public static async Task <TeamsMeetingParticipant> FetchParticipantAsync(this ITeamsOperations operations, string meetingId, string participantId, string tenantId, CancellationToken cancellationToken = default(CancellationToken)) { if (operations is TeamsOperations teamsOperations) { using (var result = await teamsOperations.FetchParticipantWithHttpMessagesAsync(meetingId, participantId, tenantId, null, cancellationToken).ConfigureAwait(false)) { return(result.Body); } } else { throw new InvalidOperationException("TeamsOperations with GetParticipantWithHttpMessagesAsync is required for FetchParticipantAsync."); } }
/// <summary> /// Fetches channel list for a given team /// </summary> /// <remarks> /// Fetch the channel list. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='teamsId'> /// Team Id /// </param> public static ConversationList FetchChannelList(this ITeamsOperations operations, string teamsId) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ITeamsOperations)s).FetchChannelListAsync(teamsId), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }