# Google Cloud Sql Admin V1 Client - Class Flag (1.9.0)

1.9.0 (latest) 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.1 1.2.6 1.1.0 1.0.0 0.19.0 0.18.0 0.17.1 0.16.1 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.1 0.3.1 0.2.12 Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class Flag.

A flag resource.

Generated from protobuf message `google.cloud.sql.v1.Flag`

## Namespace

Google \\ Cloud \\ Sql \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` This is the name of the flag. Flag names always use underscores, not hyphens, for example: `max_allowed_packet` |
| `↳ type` | `int` The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`, `INTEGER` or `NONE`. `NONE` is used for flags that do not take a value, such as `skip_grant_tables`. |
| `↳ applies_to` | `int[]` The database version this flag applies to. Can be MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`, or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, `POSTGRES_11` or `POSTGRES_12`. SQL Server instances: `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or `SQLSERVER_2019_WEB`. See [the complete list](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). |
| `↳ allowed_string_values` | `string[]` For `STRING` flags, a list of strings that the value can be set to. |
| `↳ min_value` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` For `INTEGER` flags, the minimum allowed value. |
| `↳ max_value` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` For `INTEGER` flags, the maximum allowed value. |
| `↳ requires_restart` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` Indicates whether changing this flag will trigger a database restart. Only applicable to Second Generation instances. |
| `↳ kind` | `string` This is always `sql#flag`. |
| `↳ in_beta` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` Whether or not the flag is considered in beta. |
| `↳ allowed_int_values` | `int[]|string[]` Use this field if only certain integers are accepted. Can be combined with min_value and max_value to add additional values. |
| `↳ flag_scope` | `int` Scope of flag. |
| `↳ recommended_string_value` | `string` Recommended string value in string format for UI display. |
| `↳ recommended_int_value` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` Recommended int value in integer format for UI display. |

### getName

This is the name of the flag. Flag names always use underscores, not
hyphens, for example: `max_allowed_packet`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

This is the name of the flag. Flag names always use underscores, not
hyphens, for example: `max_allowed_packet`

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

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

### getType

The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
`INTEGER` or `NONE`. `NONE` is used for flags that do not take a
value, such as `skip_grant_tables`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SqlFlagType](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.SqlFlagType). |

### setType

The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
`INTEGER` or `NONE`. `NONE` is used for flags that do not take a
value, such as `skip_grant_tables`.

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

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

### getAppliesTo

The database version this flag applies to. Can be
MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
`POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
`SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
`SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
`SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
`SQLSERVER_2019_WEB`.

See [the complete
list](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setAppliesTo

The database version this flag applies to. Can be
MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
`POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
`SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
`SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
`SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
`SQLSERVER_2019_WEB`.

See [the complete
list](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).

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

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

### getAllowedStringValues

For `STRING` flags, a list of strings that the value can be set to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedStringValues

For `STRING` flags, a list of strings that the value can be set to.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

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

### getMinValue

For `INTEGER` flags, the minimum allowed value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value|null` |   |

### hasMinValue

### clearMinValue

### getMinValueUnwrapped

Returns the unboxed value from `getMinValue()`

For `INTEGER` flags, the minimum allowed value.

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

### setMinValue

For `INTEGER` flags, the minimum allowed value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` |

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

### setMinValueUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int64Value object.

For `INTEGER` flags, the minimum allowed value.

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

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

### getMaxValue

For `INTEGER` flags, the maximum allowed value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value|null` |   |

### hasMaxValue

### clearMaxValue

### getMaxValueUnwrapped

Returns the unboxed value from `getMaxValue()`

For `INTEGER` flags, the maximum allowed value.

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

### setMaxValue

For `INTEGER` flags, the maximum allowed value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` |

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

### setMaxValueUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int64Value object.

For `INTEGER` flags, the maximum allowed value.

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

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

### getRequiresRestart

Indicates whether changing this flag will trigger a database restart. Only
applicable to Second Generation instances.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue|null` |   |

### hasRequiresRestart

### clearRequiresRestart

### getRequiresRestartUnwrapped

Returns the unboxed value from `getRequiresRestart()`

Indicates whether changing this flag will trigger a database restart. Only
applicable to Second Generation instances.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool|null` |   |

### setRequiresRestart

Indicates whether changing this flag will trigger a database restart. Only
applicable to Second Generation instances.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` |

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

### setRequiresRestartUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\BoolValue object.

Indicates whether changing this flag will trigger a database restart. Only
applicable to Second Generation instances.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool|null` |

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

### getKind

This is always `sql#flag`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setKind

This is always `sql#flag`.

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

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

### getInBeta

Whether or not the flag is considered in beta.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue|null` |   |

### hasInBeta

### clearInBeta

### getInBetaUnwrapped

Returns the unboxed value from `getInBeta()`

Whether or not the flag is considered in beta.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool|null` |   |

### setInBeta

Whether or not the flag is considered in beta.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` |

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

### setInBetaUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\BoolValue object.

Whether or not the flag is considered in beta.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool|null` |

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

### getAllowedIntValues

Use this field if only certain integers are accepted. Can be combined
with min_value and max_value to add additional values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedIntValues

Use this field if only certain integers are accepted. Can be combined
with min_value and max_value to add additional values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]|string[]` |

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

### getFlagScope

Scope of flag.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SqlFlagScope](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.SqlFlagScope). |

### setFlagScope

Scope of flag.

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

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

### getRecommendedStringValue

Recommended string value in string format for UI display.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasRecommendedStringValue

### setRecommendedStringValue

Recommended string value in string format for UI display.

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

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

### getRecommendedIntValue

Recommended int value in integer format for UI display.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value|null` |   |

### hasRecommendedIntValue

### getRecommendedIntValueUnwrapped

Returns the unboxed value from `getRecommendedIntValue()`

Recommended int value in integer format for UI display.

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

### setRecommendedIntValue

Recommended int value in integer format for UI display.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int64Value` |

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

### setRecommendedIntValueUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int64Value object.

Recommended int value in integer format for UI display.

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

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

### getRecommendedValue

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |