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