# Cloud AutoML V1 Client - Class Layout (2.1.3)

2.1.3 (latest) 2.1.2 2.0.5 1.6.5 1.5.4 1.4.17 Reference documentation and code samples for the Cloud AutoML V1 Client class Layout.

Describes the layout information of a [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the document.

Generated from protobuf message `google.cloud.automl.v1.Document.Layout`

## Namespace

Google \\ Cloud \\ AutoMl \\ V1 \\ Document

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text_segment` | `https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.TextSegment` Text Segment that represents a segment in document_text. |
| `↳ page_number` | `int` Page number of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the original document, starts from 1. |
| `↳ bounding_poly` | `https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.BoundingPoly` The position of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the page. Contains exactly 4 normalized_vertices and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The NormalizedVertex-s are relative to the page. Coordinates are based on top-left as point (0,0). |
| `↳ text_segment_type` | `int` The type of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in document. |

### getTextSegment

Text Segment that represents a segment in
document_text.

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

### hasTextSegment

### clearTextSegment

### setTextSegment

Text Segment that represents a segment in
document_text.

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

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

### getPageNumber

Page number of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the original document, starts
from 1.

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

### setPageNumber

Page number of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the original document, starts
from 1.

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

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

### getBoundingPoly

The position of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the page.

Contains exactly 4
normalized_vertices
and they are connected by edges in the order provided, which will
represent a rectangle parallel to the frame. The
NormalizedVertex-s are
relative to the page.
Coordinates are based on top-left as point (0,0).

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

### hasBoundingPoly

### clearBoundingPoly

### setBoundingPoly

The position of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in the page.

Contains exactly 4
normalized_vertices
and they are connected by edges in the order provided, which will
represent a rectangle parallel to the frame. The
NormalizedVertex-s are
relative to the page.
Coordinates are based on top-left as point (0,0).

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

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

### getTextSegmentType

The type of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in document.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TextSegmentType](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout.TextSegmentType). |

### setTextSegmentType

The type of the [text_segment](https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.Document.Layout#_Google_Cloud_AutoMl_V1_Document_Layout__getTextSegment__) in document.

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

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