# Google Cloud Network Security V1 Client - Class CreateGatewaySecurityPolicyRuleRequest (1.4.0)

1.4.0 (latest) 1.3.0 1.2.3 1.1.0 1.0.4 0.6.5 0.5.2 0.4.1 0.3.7 Reference documentation and code samples for the Google Cloud Network Security V1 Client class CreateGatewaySecurityPolicyRuleRequest.

Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules.

Request used by the CreateGatewaySecurityPolicyRule method.

Generated from protobuf message `google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest`

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/\* |
| `↳ gateway_security_policy_rule` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.GatewaySecurityPolicyRule` Required. The rule to be created. |
| `↳ gateway_security_policy_rule_id` | `string` The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

### getParent

Required. The parent where this rule will be created.

Format :
projects/{project}/location/{location}/gatewaySecurityPolicies/\*

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

### setParent

Required. The parent where this rule will be created.

Format :
projects/{project}/location/{location}/gatewaySecurityPolicies/\*

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

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

### getGatewaySecurityPolicyRule

Required. The rule to be created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.GatewaySecurityPolicyRule|null` |   |

### hasGatewaySecurityPolicyRule

### clearGatewaySecurityPolicyRule

### setGatewaySecurityPolicyRule

Required. The rule to be created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.GatewaySecurityPolicyRule` |

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

### getGatewaySecurityPolicyRuleId

The ID to use for the rule, which will become the final component of
the rule's resource name.

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

### setGatewaySecurityPolicyRuleId

The ID to use for the rule, which will become the final component of
the rule's resource name.

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent where this rule will be created. Format : projects/{project}/location/{location}/gatewaySecurityPolicies/\* Please see NetworkSecurityClient::gatewaySecurityPolicyName() for help formatting this field. |
| `gatewaySecurityPolicyRule` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.GatewaySecurityPolicyRule` Required. The rule to be created. |
| `gatewaySecurityPolicyRuleId` | `string` The ID to use for the rule, which will become the final component of the rule's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.CreateGatewaySecurityPolicyRuleRequest` |   |