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