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