/// <summary>
 /// Adds the specified PrivilegedSignupStatus to the collection via POST.
 /// </summary>
 /// <param name="privilegedSignupStatus">The PrivilegedSignupStatus to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created PrivilegedSignupStatus.</returns>
 public System.Threading.Tasks.Task <PrivilegedSignupStatus> AddAsync(PrivilegedSignupStatus privilegedSignupStatus, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <PrivilegedSignupStatus>(privilegedSignupStatus, cancellationToken));
 }
 /// <summary>
 /// Adds the specified PrivilegedSignupStatus to the collection via POST.
 /// </summary>
 /// <param name="privilegedSignupStatus">The PrivilegedSignupStatus to add.</param>
 /// <returns>The created PrivilegedSignupStatus.</returns>
 public System.Threading.Tasks.Task <PrivilegedSignupStatus> AddAsync(PrivilegedSignupStatus privilegedSignupStatus)
 {
     return(this.AddAsync(privilegedSignupStatus, CancellationToken.None));
 }
        /// <summary>
        /// Creates the specified PrivilegedSignupStatus using POST.
        /// </summary>
        /// <param name="privilegedSignupStatusToCreate">The PrivilegedSignupStatus to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created PrivilegedSignupStatus.</returns>
        public async System.Threading.Tasks.Task <PrivilegedSignupStatus> CreateAsync(PrivilegedSignupStatus privilegedSignupStatusToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <PrivilegedSignupStatus>(privilegedSignupStatusToCreate, cancellationToken).ConfigureAwait(false);

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }