# Google Cloud Network Connectivity V1 Client - Class AllocationOptions (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.0 2.2.2 2.1.2 2.0.2 1.5.5 1.4.2 1.3.0 1.2.0 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Network Connectivity V1 Client class AllocationOptions.

Range auto-allocation options, to be optionally used when CIDR block is not
explicitly set.

Generated from protobuf message `google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions`

## Namespace

Google \\ Cloud \\ NetworkConnectivity \\ V1 \\ InternalRange

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ allocation_strategy` | `int` Optional. Allocation strategy Not setting this field when the allocation is requested means an implementation defined strategy is used. |
| `↳ first_available_ranges_lookup_size` | `int` Optional. This field must be set only when allocation_strategy is set to RANDOM_FIRST_N_AVAILABLE. The value should be the maximum expected parallelism of range creation requests issued to the same space of peered netwroks. |

### getAllocationStrategy

Optional. Allocation strategy Not setting this field when the allocation
is requested means an implementation defined strategy is used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [AllocationStrategy](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.InternalRange.AllocationStrategy). |

### setAllocationStrategy

Optional. Allocation strategy Not setting this field when the allocation
is requested means an implementation defined strategy is used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [AllocationStrategy](https://docs.cloud.google.com/php/docs/reference/cloud-network-connectivity/latest/V1.InternalRange.AllocationStrategy). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFirstAvailableRangesLookupSize

Optional. This field must be set only when allocation_strategy is set to
RANDOM_FIRST_N_AVAILABLE.

The value should be the maximum expected parallelism of range creation
requests issued to the same space of peered netwroks.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setFirstAvailableRangesLookupSize

Optional. This field must be set only when allocation_strategy is set to
RANDOM_FIRST_N_AVAILABLE.

The value should be the maximum expected parallelism of range creation
requests issued to the same space of peered netwroks.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |