IndexerExecutionResult.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.

  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Immutable;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;
  11. import java.time.OffsetDateTime;
  12. import java.util.List;

  13. /** Represents the result of an individual indexer execution. */
  14. @Immutable
  15. public final class IndexerExecutionResult {
  16.     /*
  17.      * The outcome of this indexer execution.
  18.      */
  19.     @JsonProperty(value = "status", required = true, access = JsonProperty.Access.WRITE_ONLY)
  20.     private IndexerExecutionStatus status;

  21.     /*
  22.      * The outcome of this indexer execution.
  23.      */
  24.     @JsonProperty(value = "statusDetail", access = JsonProperty.Access.WRITE_ONLY)
  25.     private IndexerExecutionStatusDetail statusDetail;

  26.     /*
  27.      * All of the state that defines and dictates the indexer's current
  28.      * execution.
  29.      */
  30.     @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY)
  31.     private IndexerCurrentState currentState;

  32.     /*
  33.      * The error message indicating the top-level error, if any.
  34.      */
  35.     @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY)
  36.     private String errorMessage;

  37.     /*
  38.      * The start time of this indexer execution.
  39.      */
  40.     @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
  41.     private OffsetDateTime startTime;

  42.     /*
  43.      * The end time of this indexer execution, if the execution has already
  44.      * completed.
  45.      */
  46.     @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
  47.     private OffsetDateTime endTime;

  48.     /*
  49.      * The item-level indexing errors.
  50.      */
  51.     @JsonProperty(value = "errors", required = true, access = JsonProperty.Access.WRITE_ONLY)
  52.     private List<SearchIndexerError> errors;

  53.     /*
  54.      * The item-level indexing warnings.
  55.      */
  56.     @JsonProperty(value = "warnings", required = true, access = JsonProperty.Access.WRITE_ONLY)
  57.     private List<SearchIndexerWarning> warnings;

  58.     /*
  59.      * The number of items that were processed during this indexer execution.
  60.      * This includes both successfully processed items and items where indexing
  61.      * was attempted but failed.
  62.      */
  63.     @JsonProperty(value = "itemsProcessed", required = true, access = JsonProperty.Access.WRITE_ONLY)
  64.     private int itemCount;

  65.     /*
  66.      * The number of items that failed to be indexed during this indexer
  67.      * execution.
  68.      */
  69.     @JsonProperty(value = "itemsFailed", required = true, access = JsonProperty.Access.WRITE_ONLY)
  70.     private int failedItemCount;

  71.     /*
  72.      * Change tracking state with which an indexer execution started.
  73.      */
  74.     @JsonProperty(value = "initialTrackingState", access = JsonProperty.Access.WRITE_ONLY)
  75.     private String initialTrackingState;

  76.     /*
  77.      * Change tracking state with which an indexer execution finished.
  78.      */
  79.     @JsonProperty(value = "finalTrackingState", access = JsonProperty.Access.WRITE_ONLY)
  80.     private String finalTrackingState;

  81.     /**
  82.      * Creates an instance of IndexerExecutionResult class.
  83.      *
  84.      * @param status the status value to set.
  85.      * @param errors the errors value to set.
  86.      * @param warnings the warnings value to set.
  87.      * @param itemCount the itemCount value to set.
  88.      * @param failedItemCount the failedItemCount value to set.
  89.      */
  90.     @JsonCreator
  91.     public IndexerExecutionResult(
  92.             @JsonProperty(value = "status", required = true, access = JsonProperty.Access.WRITE_ONLY)
  93.                     IndexerExecutionStatus status,
  94.             @JsonProperty(value = "errors", required = true, access = JsonProperty.Access.WRITE_ONLY)
  95.                     List<SearchIndexerError> errors,
  96.             @JsonProperty(value = "warnings", required = true, access = JsonProperty.Access.WRITE_ONLY)
  97.                     List<SearchIndexerWarning> warnings,
  98.             @JsonProperty(value = "itemsProcessed", required = true, access = JsonProperty.Access.WRITE_ONLY)
  99.                     int itemCount,
  100.             @JsonProperty(value = "itemsFailed", required = true, access = JsonProperty.Access.WRITE_ONLY)
  101.                     int failedItemCount) {
  102.         this.status = status;
  103.         this.errors = errors;
  104.         this.warnings = warnings;
  105.         this.itemCount = itemCount;
  106.         this.failedItemCount = failedItemCount;
  107.     }

  108.     /**
  109.      * Get the status property: The outcome of this indexer execution.
  110.      *
  111.      * @return the status value.
  112.      */
  113.     public IndexerExecutionStatus getStatus() {
  114.         return this.status;
  115.     }

  116.     /**
  117.      * Get the statusDetail property: The outcome of this indexer execution.
  118.      *
  119.      * @return the statusDetail value.
  120.      */
  121.     public IndexerExecutionStatusDetail getStatusDetail() {
  122.         return this.statusDetail;
  123.     }

  124.     /**
  125.      * Get the currentState property: All of the state that defines and dictates the indexer's current execution.
  126.      *
  127.      * @return the currentState value.
  128.      */
  129.     public IndexerCurrentState getCurrentState() {
  130.         return this.currentState;
  131.     }

  132.     /**
  133.      * Get the errorMessage property: The error message indicating the top-level error, if any.
  134.      *
  135.      * @return the errorMessage value.
  136.      */
  137.     public String getErrorMessage() {
  138.         return this.errorMessage;
  139.     }

  140.     /**
  141.      * Get the startTime property: The start time of this indexer execution.
  142.      *
  143.      * @return the startTime value.
  144.      */
  145.     public OffsetDateTime getStartTime() {
  146.         return this.startTime;
  147.     }

  148.     /**
  149.      * Get the endTime property: The end time of this indexer execution, if the execution has already completed.
  150.      *
  151.      * @return the endTime value.
  152.      */
  153.     public OffsetDateTime getEndTime() {
  154.         return this.endTime;
  155.     }

  156.     /**
  157.      * Get the errors property: The item-level indexing errors.
  158.      *
  159.      * @return the errors value.
  160.      */
  161.     public List<SearchIndexerError> getErrors() {
  162.         return this.errors;
  163.     }

  164.     /**
  165.      * Get the warnings property: The item-level indexing warnings.
  166.      *
  167.      * @return the warnings value.
  168.      */
  169.     public List<SearchIndexerWarning> getWarnings() {
  170.         return this.warnings;
  171.     }

  172.     /**
  173.      * Get the itemCount property: The number of items that were processed during this indexer execution. This includes
  174.      * both successfully processed items and items where indexing was attempted but failed.
  175.      *
  176.      * @return the itemCount value.
  177.      */
  178.     public int getItemCount() {
  179.         return this.itemCount;
  180.     }

  181.     /**
  182.      * Get the failedItemCount property: The number of items that failed to be indexed during this indexer execution.
  183.      *
  184.      * @return the failedItemCount value.
  185.      */
  186.     public int getFailedItemCount() {
  187.         return this.failedItemCount;
  188.     }

  189.     /**
  190.      * Get the initialTrackingState property: Change tracking state with which an indexer execution started.
  191.      *
  192.      * @return the initialTrackingState value.
  193.      */
  194.     public String getInitialTrackingState() {
  195.         return this.initialTrackingState;
  196.     }

  197.     /**
  198.      * Get the finalTrackingState property: Change tracking state with which an indexer execution finished.
  199.      *
  200.      * @return the finalTrackingState value.
  201.      */
  202.     public String getFinalTrackingState() {
  203.         return this.finalTrackingState;
  204.     }
  205. }