# Google Cloud Vision v1 API - Class BatchAnnotateImagesResponse (3.8.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.8.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.7.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.6.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.5.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.4.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.3.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.2.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.1.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/3.0.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/2.5.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/2.4.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/2.3.0/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse)

    public sealed class BatchAnnotateImagesResponse : IMessage<BatchAnnotateImagesResponse>, IEquatable<BatchAnnotateImagesResponse>, IDeepCloneable<BatchAnnotateImagesResponse>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Vision v1 API class BatchAnnotateImagesResponse.

Response to a batch image annotation request.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> BatchAnnotateImagesResponse

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BatchAnnotateImagesResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BatchAnnotateImagesResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BatchAnnotateImagesResponse](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Vision.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1)

## Assembly

Google.Cloud.Vision.V1.dll

## Constructors

### BatchAnnotateImagesResponse()

    public BatchAnnotateImagesResponse()

### BatchAnnotateImagesResponse(BatchAnnotateImagesResponse)

    public BatchAnnotateImagesResponse(BatchAnnotateImagesResponse other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse` |

## Properties

### Responses

    public RepeatedField<AnnotateImageResponse> Responses { get; }

Individual responses to image annotation requests within the batch.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.AnnotateImageResponse` |   |

## Methods

### ThrowOnAnyError()

    public BatchAnnotateImagesResponse ThrowOnAnyError()

If the [Error](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.AnnotateImageResponse#Google_Cloud_Vision_V1_AnnotateImageResponse_Error) property is non-null for any response within [Responses](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse#Google_Cloud_Vision_V1_BatchAnnotateImagesResponse_Responses),
throws an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception), containing one [AnnotateImageException](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.AnnotateImageException)
for each failed response. Otherwise, returns `this` (so that the method can be called in a fluent manner).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse` | `this` if no responses contain errors. |

**Example**

    // We create a request which passes simple validation, but isn't a valid image.
    Image image = Image.FromBytes(new byte[10]);
    // Just a single request in this example, but usually BatchAnnotateImages would be
    // used with multiple requests.
    var request = new AnnotateImageRequest
    {
        Image = image,
        Features = { new Feature { Type = Feature.Types.Type.SafeSearchDetection } }
    };
    ImageAnnotatorClient client = ImageAnnotatorClient.Create();
    try
    {
        BatchAnnotateImagesResponse response = client.BatchAnnotateImages(new[] { request });
        // ThrowOnAnyError will throw if any individual response in response.Responses
        // contains an error. Other responses may still have useful results.
        // Errors can be detected manually by checking the Error property in each
        // individual response.
        response.ThrowOnAnyError();
    }
    catch (AggregateException e)
    {
        // Because a batch can have multiple errors, the exception thrown is AggregateException.
        // Each inner exception is an AnnotateImageException
        foreach (AnnotateImageException innerException in e.InnerExceptions)
        {
            Console.WriteLine(innerException.Response.Error);
        }
    }

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.aggregateexception` | The [Error](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.AnnotateImageResponse#Google_Cloud_Vision_V1_AnnotateImageResponse_Error) property is non-null on one or more element of [Responses](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest/Google.Cloud.Vision.V1.BatchAnnotateImagesResponse#Google_Cloud_Vision_V1_BatchAnnotateImagesResponse_Responses). |