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