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

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

            return(updatedEntity);
        }
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="groupPolicyPresentationToInitialize">The <see cref="GroupPolicyPresentation"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(GroupPolicyPresentation groupPolicyPresentationToInitialize)
 {
 }
 /// <summary>
 /// Adds the specified GroupPolicyPresentation to the collection via POST.
 /// </summary>
 /// <param name="groupPolicyPresentation">The GroupPolicyPresentation to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created GroupPolicyPresentation.</returns>
 public System.Threading.Tasks.Task <GroupPolicyPresentation> AddAsync(GroupPolicyPresentation groupPolicyPresentation, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <GroupPolicyPresentation>(groupPolicyPresentation, cancellationToken));
 }
 /// <summary>
 /// Adds the specified GroupPolicyPresentation to the collection via POST.
 /// </summary>
 /// <param name="groupPolicyPresentation">The GroupPolicyPresentation to add.</param>
 /// <returns>The created GroupPolicyPresentation.</returns>
 public System.Threading.Tasks.Task <GroupPolicyPresentation> AddAsync(GroupPolicyPresentation groupPolicyPresentation)
 {
     return(this.AddAsync(groupPolicyPresentation, CancellationToken.None));
 }