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