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