SearchIndexerError.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. /** Represents an item- or document-level indexing error. */
  12. @Immutable
  13. public final class SearchIndexerError {
  14.     /*
  15.      * The key of the item for which indexing failed.
  16.      */
  17.     @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY)
  18.     private String key;

  19.     /*
  20.      * The message describing the error that occurred while processing the
  21.      * item.
  22.      */
  23.     @JsonProperty(value = "errorMessage", required = true, access = JsonProperty.Access.WRITE_ONLY)
  24.     private String errorMessage;

  25.     /*
  26.      * The status code indicating why the indexing operation failed. Possible
  27.      * values include: 400 for a malformed input document, 404 for document not
  28.      * found, 409 for a version conflict, 422 when the index is temporarily
  29.      * unavailable, or 503 for when the service is too busy.
  30.      */
  31.     @JsonProperty(value = "statusCode", required = true, access = JsonProperty.Access.WRITE_ONLY)
  32.     private int statusCode;

  33.     /*
  34.      * The name of the source at which the error originated. For example, this
  35.      * could refer to a particular skill in the attached skillset. This may not
  36.      * be always available.
  37.      */
  38.     @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
  39.     private String name;

  40.     /*
  41.      * Additional, verbose details about the error to assist in debugging the
  42.      * indexer. This may not be always available.
  43.      */
  44.     @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY)
  45.     private String details;

  46.     /*
  47.      * A link to a troubleshooting guide for these classes of errors. This may
  48.      * not be always available.
  49.      */
  50.     @JsonProperty(value = "documentationLink", access = JsonProperty.Access.WRITE_ONLY)
  51.     private String documentationLink;

  52.     /**
  53.      * Creates an instance of SearchIndexerError class.
  54.      *
  55.      * @param errorMessage the errorMessage value to set.
  56.      * @param statusCode the statusCode value to set.
  57.      */
  58.     @JsonCreator
  59.     public SearchIndexerError(
  60.             @JsonProperty(value = "errorMessage", required = true, access = JsonProperty.Access.WRITE_ONLY)
  61.                     String errorMessage,
  62.             @JsonProperty(value = "statusCode", required = true, access = JsonProperty.Access.WRITE_ONLY)
  63.                     int statusCode) {
  64.         this.errorMessage = errorMessage;
  65.         this.statusCode = statusCode;
  66.     }

  67.     /**
  68.      * Get the key property: The key of the item for which indexing failed.
  69.      *
  70.      * @return the key value.
  71.      */
  72.     public String getKey() {
  73.         return this.key;
  74.     }

  75.     /**
  76.      * Get the errorMessage property: The message describing the error that occurred while processing the item.
  77.      *
  78.      * @return the errorMessage value.
  79.      */
  80.     public String getErrorMessage() {
  81.         return this.errorMessage;
  82.     }

  83.     /**
  84.      * Get the statusCode property: The status code indicating why the indexing operation failed. Possible values
  85.      * include: 400 for a malformed input document, 404 for document not found, 409 for a version conflict, 422 when the
  86.      * index is temporarily unavailable, or 503 for when the service is too busy.
  87.      *
  88.      * @return the statusCode value.
  89.      */
  90.     public int getStatusCode() {
  91.         return this.statusCode;
  92.     }

  93.     /**
  94.      * Get the name property: The name of the source at which the error originated. For example, this could refer to a
  95.      * particular skill in the attached skillset. This may not be always available.
  96.      *
  97.      * @return the name value.
  98.      */
  99.     public String getName() {
  100.         return this.name;
  101.     }

  102.     /**
  103.      * Get the details property: Additional, verbose details about the error to assist in debugging the indexer. This
  104.      * may not be always available.
  105.      *
  106.      * @return the details value.
  107.      */
  108.     public String getDetails() {
  109.         return this.details;
  110.     }

  111.     /**
  112.      * Get the documentationLink property: A link to a troubleshooting guide for these classes of errors. This may not
  113.      * be always available.
  114.      *
  115.      * @return the documentationLink value.
  116.      */
  117.     public String getDocumentationLink() {
  118.         return this.documentationLink;
  119.     }
  120. }