Exemplo n.º 1
0
        /// <summary>
        /// Updates the specified CaseExportOperation using PATCH.
        /// </summary>
        /// <param name="caseExportOperationToUpdate">The CaseExportOperation to update.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <exception cref="Microsoft.Graph.ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>
        /// <returns>The updated CaseExportOperation.</returns>
        public async System.Threading.Tasks.Task <CaseExportOperation> UpdateAsync(CaseExportOperation caseExportOperationToUpdate, CancellationToken cancellationToken)
        {
            if (caseExportOperationToUpdate.AdditionalData != null)
            {
                if (caseExportOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.ResponseHeaders) ||
                    caseExportOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.StatusCode))
                {
                    throw new Microsoft.Graph.ClientException(
                              new Microsoft.Graph.Error
                    {
                        Code    = Microsoft.Graph.GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(Microsoft.Graph.GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, caseExportOperationToUpdate.GetType().Name)
                    });
                }
            }
            if (caseExportOperationToUpdate.AdditionalData != null)
            {
                if (caseExportOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.ResponseHeaders) ||
                    caseExportOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.StatusCode))
                {
                    throw new Microsoft.Graph.ClientException(
                              new Microsoft.Graph.Error
                    {
                        Code    = Microsoft.Graph.GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(Microsoft.Graph.GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, caseExportOperationToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <CaseExportOperation>(caseExportOperationToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the specified CaseExportOperation using POST.
        /// </summary>
        /// <param name="caseExportOperationToCreate">The CaseExportOperation to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created CaseExportOperation.</returns>
        public async System.Threading.Tasks.Task <CaseExportOperation> CreateAsync(CaseExportOperation caseExportOperationToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <CaseExportOperation>(caseExportOperationToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates the specified CaseExportOperation using POST.
 /// </summary>
 /// <param name="caseExportOperationToCreate">The CaseExportOperation to create.</param>
 /// <returns>The created CaseExportOperation.</returns>
 public System.Threading.Tasks.Task <CaseExportOperation> CreateAsync(CaseExportOperation caseExportOperationToCreate)
 {
     return(this.CreateAsync(caseExportOperationToCreate, CancellationToken.None));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="caseExportOperationToInitialize">The <see cref="CaseExportOperation"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(CaseExportOperation caseExportOperationToInitialize)
 {
 }