Example #1
0
        /// <summary>
        /// Updates the specified PlannerRosterMember using PATCH.
        /// </summary>
        /// <param name="plannerRosterMemberToUpdate">The PlannerRosterMember 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 PlannerRosterMember.</returns>
        public async System.Threading.Tasks.Task <PlannerRosterMember> UpdateAsync(PlannerRosterMember plannerRosterMemberToUpdate, CancellationToken cancellationToken)
        {
            if (plannerRosterMemberToUpdate.AdditionalData != null)
            {
                if (plannerRosterMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    plannerRosterMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, plannerRosterMemberToUpdate.GetType().Name)
                    });
                }
            }
            if (plannerRosterMemberToUpdate.AdditionalData != null)
            {
                if (plannerRosterMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    plannerRosterMemberToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, plannerRosterMemberToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <PlannerRosterMember>(plannerRosterMemberToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Example #2
0
        /// <summary>
        /// Creates the specified PlannerRosterMember using POST.
        /// </summary>
        /// <param name="plannerRosterMemberToCreate">The PlannerRosterMember to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created PlannerRosterMember.</returns>
        public async System.Threading.Tasks.Task <PlannerRosterMember> CreateAsync(PlannerRosterMember plannerRosterMemberToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <PlannerRosterMember>(plannerRosterMemberToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Example #3
0
 /// <summary>
 /// Creates the specified PlannerRosterMember using POST.
 /// </summary>
 /// <param name="plannerRosterMemberToCreate">The PlannerRosterMember to create.</param>
 /// <returns>The created PlannerRosterMember.</returns>
 public System.Threading.Tasks.Task <PlannerRosterMember> CreateAsync(PlannerRosterMember plannerRosterMemberToCreate)
 {
     return(this.CreateAsync(plannerRosterMemberToCreate, CancellationToken.None));
 }
Example #4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="plannerRosterMemberToInitialize">The <see cref="PlannerRosterMember"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(PlannerRosterMember plannerRosterMemberToInitialize)
 {
 }
Example #5
0
 /// <summary>
 /// Adds the specified PlannerRosterMember to the collection via POST.
 /// </summary>
 /// <param name="plannerRosterMember">The PlannerRosterMember to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created PlannerRosterMember.</returns>
 public System.Threading.Tasks.Task <PlannerRosterMember> AddAsync(PlannerRosterMember plannerRosterMember, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <PlannerRosterMember>(plannerRosterMember, cancellationToken));
 }
Example #6
0
 /// <summary>
 /// Adds the specified PlannerRosterMember to the collection via POST.
 /// </summary>
 /// <param name="plannerRosterMember">The PlannerRosterMember to add.</param>
 /// <returns>The created PlannerRosterMember.</returns>
 public System.Threading.Tasks.Task <PlannerRosterMember> AddAsync(PlannerRosterMember plannerRosterMember)
 {
     return(this.AddAsync(plannerRosterMember, CancellationToken.None));
 }