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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Beispiel #5
0
 /// <summary>
 /// Adds the specified MacOSSoftwareUpdateStateSummary to the collection via POST.
 /// </summary>
 /// <param name="macOSSoftwareUpdateStateSummary">The MacOSSoftwareUpdateStateSummary to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created MacOSSoftwareUpdateStateSummary.</returns>
 public System.Threading.Tasks.Task <MacOSSoftwareUpdateStateSummary> AddAsync(MacOSSoftwareUpdateStateSummary macOSSoftwareUpdateStateSummary, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <MacOSSoftwareUpdateStateSummary>(macOSSoftwareUpdateStateSummary, cancellationToken));
 }
Beispiel #6
0
 /// <summary>
 /// Adds the specified MacOSSoftwareUpdateStateSummary to the collection via POST.
 /// </summary>
 /// <param name="macOSSoftwareUpdateStateSummary">The MacOSSoftwareUpdateStateSummary to add.</param>
 /// <returns>The created MacOSSoftwareUpdateStateSummary.</returns>
 public System.Threading.Tasks.Task <MacOSSoftwareUpdateStateSummary> AddAsync(MacOSSoftwareUpdateStateSummary macOSSoftwareUpdateStateSummary)
 {
     return(this.AddAsync(macOSSoftwareUpdateStateSummary, CancellationToken.None));
 }