Example #1
0
 /// <summary>
 /// Gets the request builder for InformationProtectionEvaluateLabelsAndPolicies.
 /// </summary>
 /// <returns>The <see cref="IInformationProtectionEvaluateLabelsAndPoliciesRequestBuilder"/>.</returns>
 public IInformationProtectionEvaluateLabelsAndPoliciesRequestBuilder EvaluateLabelsAndPolicies(
     EvaluateSensitivityLabelsRequestObject evaluateSensitivityLabels    = null,
     DlpEvaluatePoliciesRequestObject evaluateDataLossPreventionPolicies = null,
     TextClassificationRequestObject classifyText = null)
 {
     return(new InformationProtectionEvaluateLabelsAndPoliciesRequestBuilder(
                this.AppendSegmentToRequestUrl("microsoft.graph.evaluateLabelsAndPolicies"),
                this.Client,
                evaluateSensitivityLabels,
                evaluateDataLossPreventionPolicies,
                classifyText));
 }
 /// <summary>
 /// Constructs a new <see cref="InformationProtectionEvaluateLabelsAndPoliciesRequestBuilder"/>.
 /// </summary>
 /// <param name="requestUrl">The URL for the request.</param>
 /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
 /// <param name="evaluateSensitivityLabels">A evaluateSensitivityLabels parameter for the OData method call.</param>
 /// <param name="evaluateDataLossPreventionPolicies">A evaluateDataLossPreventionPolicies parameter for the OData method call.</param>
 /// <param name="classifyText">A classifyText parameter for the OData method call.</param>
 public InformationProtectionEvaluateLabelsAndPoliciesRequestBuilder(
     string requestUrl,
     IBaseClient client,
     EvaluateSensitivityLabelsRequestObject evaluateSensitivityLabels,
     DlpEvaluatePoliciesRequestObject evaluateDataLossPreventionPolicies,
     TextClassificationRequestObject classifyText)
     : base(requestUrl, client)
 {
     this.SetParameter("evaluateSensitivityLabels", evaluateSensitivityLabels, true);
     this.SetParameter("evaluateDataLossPreventionPolicies", evaluateDataLossPreventionPolicies, true);
     this.SetParameter("classifyText", classifyText, true);
 }
Example #3
0
 /// <summary>
 /// Adds the specified TextClassificationRequestObject to the collection via POST.
 /// </summary>
 /// <param name="textClassificationRequest">The TextClassificationRequestObject to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created TextClassificationRequestObject.</returns>
 public System.Threading.Tasks.Task <TextClassificationRequestObject> AddAsync(TextClassificationRequestObject textClassificationRequest, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <TextClassificationRequestObject>(textClassificationRequest, cancellationToken));
 }
Example #4
0
 /// <summary>
 /// Adds the specified TextClassificationRequestObject to the collection via POST.
 /// </summary>
 /// <param name="textClassificationRequest">The TextClassificationRequestObject to add.</param>
 /// <returns>The created TextClassificationRequestObject.</returns>
 public System.Threading.Tasks.Task <TextClassificationRequestObject> AddAsync(TextClassificationRequestObject textClassificationRequest)
 {
     return(this.AddAsync(textClassificationRequest, CancellationToken.None));
 }
        /// <summary>
        /// Creates the specified TextClassificationRequestObject using POST.
        /// </summary>
        /// <param name="textClassificationRequestObjectToCreate">The TextClassificationRequestObject to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created TextClassificationRequestObject.</returns>
        public async System.Threading.Tasks.Task <TextClassificationRequestObject> CreateAsync(TextClassificationRequestObject textClassificationRequestObjectToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <TextClassificationRequestObject>(textClassificationRequestObjectToCreate, cancellationToken).ConfigureAwait(false);

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }