/// <summary> /// Updates the specified BookingStaffMember using PATCH. /// </summary> /// <param name="bookingStaffMemberToUpdate">The BookingStaffMember 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 BookingStaffMember.</returns> public async System.Threading.Tasks.Task <BookingStaffMember> UpdateAsync(BookingStaffMember bookingStaffMemberToUpdate, CancellationToken cancellationToken) { if (bookingStaffMemberToUpdate.AdditionalData != null) { if (bookingStaffMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || bookingStaffMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, bookingStaffMemberToUpdate.GetType().Name) }); } } if (bookingStaffMemberToUpdate.AdditionalData != null) { if (bookingStaffMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || bookingStaffMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, bookingStaffMemberToUpdate.GetType().Name) }); } } this.ContentType = "application/json"; this.Method = "PATCH"; var updatedEntity = await this.SendAsync <BookingStaffMember>(bookingStaffMemberToUpdate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(updatedEntity); return(updatedEntity); }
/// <summary> /// Creates the specified BookingStaffMember using POST. /// </summary> /// <param name="bookingStaffMemberToCreate">The BookingStaffMember to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created BookingStaffMember.</returns> public async System.Threading.Tasks.Task <BookingStaffMember> CreateAsync(BookingStaffMember bookingStaffMemberToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; var newEntity = await this.SendAsync <BookingStaffMember>(bookingStaffMemberToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return(newEntity); }
/// <summary> /// Adds the specified BookingStaffMember to the collection via POST. /// </summary> /// <param name="bookingStaffMember">The BookingStaffMember to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created BookingStaffMember.</returns> public System.Threading.Tasks.Task <BookingStaffMember> AddAsync(BookingStaffMember bookingStaffMember, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <BookingStaffMember>(bookingStaffMember, cancellationToken)); }
/// <summary> /// Adds the specified BookingStaffMember to the collection via POST. /// </summary> /// <param name="bookingStaffMember">The BookingStaffMember to add.</param> /// <returns>The created BookingStaffMember.</returns> public System.Threading.Tasks.Task <BookingStaffMember> AddAsync(BookingStaffMember bookingStaffMember) { return(this.AddAsync(bookingStaffMember, CancellationToken.None)); }
/// <summary> /// Creates the specified BookingStaffMember using POST. /// </summary> /// <param name="bookingStaffMemberToCreate">The BookingStaffMember to create.</param> /// <returns>The created BookingStaffMember.</returns> public System.Threading.Tasks.Task <BookingStaffMember> CreateAsync(BookingStaffMember bookingStaffMemberToCreate) { return(this.CreateAsync(bookingStaffMemberToCreate, CancellationToken.None)); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="bookingStaffMemberToInitialize">The <see cref="BookingStaffMember"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(BookingStaffMember bookingStaffMemberToInitialize) { }