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

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

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