# `Kayrock.Fetch.V4.Request`
[🔗](https://github.com/kafkaex/kayrock/blob/main/lib/generated/fetch.ex#L637)

Kayrock-generated request struct for Kafka `fetch` v4 API
messages

The schema of this API is
```
[
  replica_id: :int32,
  max_wait_time: :int32,
  min_bytes: :int32,
  max_bytes: :int32,
  isolation_level: :int8,
  topics: {:array,
   [
     topic: :string,
     partitions: {:array,
      [partition: :int32, fetch_offset: :int64, partition_max_bytes: :int32]}
   ]}
]
```

# `t`

```elixir
@type t() :: %Kayrock.Fetch.V4.Request{
  client_id: nil | binary(),
  correlation_id: nil | integer(),
  isolation_level: nil | integer(),
  max_bytes: nil | integer(),
  max_wait_time: nil | integer(),
  min_bytes: nil | integer(),
  replica_id: nil | integer(),
  topics: [
    %{
      topic: nil | binary(),
      partitions: [
        %{
          partition: nil | integer(),
          fetch_offset: nil | integer(),
          partition_max_bytes: nil | integer()
        }
      ]
    }
  ]
}
```

Request struct for the Kafka `fetch` API v4

# `api_key`

```elixir
@spec api_key() :: integer()
```

Returns the Kafka API key for this API

# `api_vsn`

```elixir
@spec api_vsn() :: integer()
```

Returns the API version (4) implemented by this module

# `response_deserializer`

```elixir
@spec response_deserializer() :: (binary() -&gt;
                              {Kayrock.Fetch.V4.Response.t(), binary()})
```

Returns a function that can be used to deserialize the wire response from the
broker for this message type

# `schema`

```elixir
@spec schema() :: term()
```

Returns the schema of this message

See [above](#).

# `serialize`

```elixir
@spec serialize(t()) :: iodata()
```

Serialize a message to binary data for transfer to a Kafka broker

---

*Consult [api-reference.md](api-reference.md) for complete listing*
