/// <summary> /// Updates the specified OnlineMeeting using PATCH. /// </summary> /// <param name="onlineMeetingToUpdate">The OnlineMeeting to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The updated OnlineMeeting.</returns> public async System.Threading.Tasks.Task <OnlineMeeting> UpdateAsync(OnlineMeeting onlineMeetingToUpdate, CancellationToken cancellationToken) { if (onlineMeetingToUpdate.AdditionalData != null) { if (onlineMeetingToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || onlineMeetingToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, onlineMeetingToUpdate.GetType().Name) }); } } if (onlineMeetingToUpdate.AdditionalData != null) { if (onlineMeetingToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || onlineMeetingToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, onlineMeetingToUpdate.GetType().Name) }); } } this.ContentType = "application/json"; this.Method = "PATCH"; var updatedEntity = await this.SendAsync <OnlineMeeting>(onlineMeetingToUpdate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(updatedEntity); return(updatedEntity); }
/// <summary> /// Creates a new adhoc online meeting. /// Permissions required : OnlineMeetings.ReadWrite.All. /// </summary> /// <param name="tenantId">The tenant identifier.</param> /// <param name="organizerId">The meeting organizer identifier.</param> /// <param name="scenarioId">The scenario identifier - needed in case of debugging for correlating client side request with server side logs.</param> /// <returns> The onlinemeeting. </returns> public async Task <Microsoft.Graph.OnlineMeeting> CreateOnlineMeetingAsync(string tenantId, string organizerId, Guid scenarioId) { var statelessClient = new CallsGraphServiceClient( this.graphEndpointUri.AbsoluteUri, this.GetAuthenticationProvider(tenantId, scenarioId)); var meetingRequest = statelessClient.App.OnlineMeetings.Request(); var onlineMeeting = new Microsoft.Graph.OnlineMeeting() { MeetingType = MeetingType.MeetNow, Participants = new MeetingParticipants() { Organizer = new MeetingParticipantInfo() { Identity = new IdentitySet() { User = new Identity() { Id = organizerId, }, }, }, }, Subject = "Test meeting.", }; var meeting = await meetingRequest.AddAsync(onlineMeeting).ConfigureAwait(false); return(meeting); }
/// <summary> /// Creates the specified OnlineMeeting using POST. /// </summary> /// <param name="onlineMeetingToCreate">The OnlineMeeting to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created OnlineMeeting.</returns> public async System.Threading.Tasks.Task<OnlineMeeting> CreateAsync(OnlineMeeting onlineMeetingToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; var newEntity = await this.SendAsync<OnlineMeeting>(onlineMeetingToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return newEntity; }
/// <summary> /// Creates a new online meeting. Meeting organizer would be the oid of the token. /// Permissions required : OnlineMeetings.ReadWrite. /// </summary> /// <param name="tenantId">The tenant identifier.</param> /// <param name="scenarioId">The scenario identifier - needed in case of debugging for correlating client side request with server side logs.</param> /// <returns> The onlinemeeting. </returns> public async Task <Microsoft.Graph.OnlineMeeting> CreateUserMeetingRequestAsync(string tenantId, Guid scenarioId) { var statelessClient = new CallsGraphServiceClientEx( this.graphEndpointUri.AbsoluteUri, this.GetAuthenticationProvider(tenantId, scenarioId)); var meetingRequest = statelessClient.Me.OnlineMeetings.Request(); DateTimeOffset startTime = new DateTimeOffset(DateTime.Now, TimeZoneInfo.Local.GetUtcOffset(DateTime.Now)); DateTimeOffset endTime = new DateTimeOffset(DateTime.Now.AddMinutes(30), TimeZoneInfo.Local.GetUtcOffset(DateTime.Now)); var onlineMeeting = new Microsoft.Graph.OnlineMeeting() { Subject = "Test User Meeting", StartDateTime = startTime, EndDateTime = endTime, }; var meeting = await meetingRequest.AddAsync(onlineMeeting).ConfigureAwait(false); return(meeting); }
/// <summary> /// Adds the specified OnlineMeeting to the collection via POST. /// </summary> /// <param name="onlineMeeting">The OnlineMeeting to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created OnlineMeeting.</returns> public System.Threading.Tasks.Task <OnlineMeeting> AddAsync(OnlineMeeting onlineMeeting, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <OnlineMeeting>(onlineMeeting, cancellationToken)); }
/// <summary> /// Adds the specified OnlineMeeting to the collection via POST. /// </summary> /// <param name="onlineMeeting">The OnlineMeeting to add.</param> /// <returns>The created OnlineMeeting.</returns> public System.Threading.Tasks.Task <OnlineMeeting> AddAsync(OnlineMeeting onlineMeeting) { return(this.AddAsync(onlineMeeting, CancellationToken.None)); }
/// <summary> /// Creates the specified OnlineMeeting using POST. /// </summary> /// <param name="onlineMeetingToCreate">The OnlineMeeting to create.</param> /// <returns>The created OnlineMeeting.</returns> public System.Threading.Tasks.Task <OnlineMeeting> CreateAsync(OnlineMeeting onlineMeetingToCreate) { return(this.CreateAsync(onlineMeetingToCreate, CancellationToken.None)); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="onlineMeetingToInitialize">The <see cref="OnlineMeeting"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(OnlineMeeting onlineMeetingToInitialize) { }
/// <summary> /// Updates the specified OnlineMeeting using PATCH. /// </summary> /// <param name="onlineMeetingToUpdate">The OnlineMeeting to update.</param> /// <returns>The updated OnlineMeeting.</returns> public System.Threading.Tasks.Task<OnlineMeeting> UpdateAsync(OnlineMeeting onlineMeetingToUpdate) { return this.UpdateAsync(onlineMeetingToUpdate, CancellationToken.None); }