Exemple #1
0
 /// <summary>
 /// Updates the specified PrivilegedRoleAssignmentRequestObject using PATCH.
 /// </summary>
 /// <param name="privilegedRoleAssignmentRequestObjectToUpdate">The PrivilegedRoleAssignmentRequestObject to update.</param>
 /// <returns>The updated PrivilegedRoleAssignmentRequestObject.</returns>
 public System.Threading.Tasks.Task <PrivilegedRoleAssignmentRequestObject> UpdateAsync(PrivilegedRoleAssignmentRequestObject privilegedRoleAssignmentRequestObjectToUpdate)
 {
     return(this.UpdateAsync(privilegedRoleAssignmentRequestObjectToUpdate, CancellationToken.None));
 }
Exemple #2
0
        /// <summary>
        /// Creates the specified PrivilegedRoleAssignmentRequestObject using POST.
        /// </summary>
        /// <param name="privilegedRoleAssignmentRequestObjectToCreate">The PrivilegedRoleAssignmentRequestObject to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created PrivilegedRoleAssignmentRequestObject.</returns>
        public async System.Threading.Tasks.Task <PrivilegedRoleAssignmentRequestObject> CreateAsync(PrivilegedRoleAssignmentRequestObject privilegedRoleAssignmentRequestObjectToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <PrivilegedRoleAssignmentRequestObject>(privilegedRoleAssignmentRequestObjectToCreate, cancellationToken).ConfigureAwait(false);

            return(newEntity);
        }
Exemple #3
0
 /// <summary>
 /// Adds the specified PrivilegedRoleAssignmentRequestObject to the collection via POST.
 /// </summary>
 /// <param name="privilegedRoleAssignmentRequest">The PrivilegedRoleAssignmentRequestObject to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created PrivilegedRoleAssignmentRequestObject.</returns>
 public System.Threading.Tasks.Task <PrivilegedRoleAssignmentRequestObject> AddAsync(PrivilegedRoleAssignmentRequestObject privilegedRoleAssignmentRequest, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <PrivilegedRoleAssignmentRequestObject>(privilegedRoleAssignmentRequest, cancellationToken));
 }
Exemple #4
0
        /// <summary>
        /// Updates the specified PrivilegedRoleAssignmentRequestObject using PATCH.
        /// </summary>
        /// <param name="privilegedRoleAssignmentRequestObjectToUpdate">The PrivilegedRoleAssignmentRequestObject 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 PrivilegedRoleAssignmentRequestObject.</returns>
        public async System.Threading.Tasks.Task <PrivilegedRoleAssignmentRequestObject> UpdateAsync(PrivilegedRoleAssignmentRequestObject privilegedRoleAssignmentRequestObjectToUpdate, CancellationToken cancellationToken)
        {
            if (privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData != null)
            {
                if (privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, privilegedRoleAssignmentRequestObjectToUpdate.GetType().Name)
                    });
                }
            }
            if (privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData != null)
            {
                if (privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    privilegedRoleAssignmentRequestObjectToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, privilegedRoleAssignmentRequestObjectToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <PrivilegedRoleAssignmentRequestObject>(privilegedRoleAssignmentRequestObjectToUpdate, cancellationToken).ConfigureAwait(false);

            return(updatedEntity);
        }
Exemple #5
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="privilegedRoleAssignmentRequestObjectToInitialize">The <see cref="PrivilegedRoleAssignmentRequestObject"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(PrivilegedRoleAssignmentRequestObject privilegedRoleAssignmentRequestObjectToInitialize)
 {
 }