Reference documentation and code samples for the Stackdriver Monitoring V3 Client class TextLocator.
A locator for text. Indicates a particular part of the text of a request or of an object referenced in the request.
For example, suppose the request field text contains:
text: "The quick brown fox jumps over the lazy dog."
Then the locator:
source: "text"
start_position {
line: 1
column: 17
}
end_position {
line: 1
column: 19
}
refers to the part of the text: "fox".
Generated from protobuf message google.monitoring.v3.TextLocator
Namespace
Google \ Cloud \ Monitoring \ V3Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ source |
string
The source of the text. The source may be a field in the request, in which case its format is the format of the google.rpc.BadRequest.FieldViolation.field field in https://cloud.google.com/apis/design/errors#error_details. It may also be be a source other than the request field (e.g. a macro definition referenced in the text of the query), in which case this is the name of the source (e.g. the macro name). |
↳ start_position |
TextLocator\Position
The position of the first byte within the text. |
↳ end_position |
TextLocator\Position
The position of the last byte within the text. |
↳ nested_locator |
TextLocator
If |
↳ nesting_reason |
string
When |
getSource
The source of the text. The source may be a field in the request, in which case its format is the format of the google.rpc.BadRequest.FieldViolation.field field in https://cloud.google.com/apis/design/errors#error_details. It may also be be a source other than the request field (e.g. a macro definition referenced in the text of the query), in which case this is the name of the source (e.g. the macro name).
| Returns | |
|---|---|
| Type | Description |
string |
|
setSource
The source of the text. The source may be a field in the request, in which case its format is the format of the google.rpc.BadRequest.FieldViolation.field field in https://cloud.google.com/apis/design/errors#error_details. It may also be be a source other than the request field (e.g. a macro definition referenced in the text of the query), in which case this is the name of the source (e.g. the macro name).
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getStartPosition
The position of the first byte within the text.
| Returns | |
|---|---|
| Type | Description |
TextLocator\Position|null |
|
hasStartPosition
clearStartPosition
setStartPosition
The position of the first byte within the text.
| Parameter | |
|---|---|
| Name | Description |
var |
TextLocator\Position
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getEndPosition
The position of the last byte within the text.
| Returns | |
|---|---|
| Type | Description |
TextLocator\Position|null |
|
hasEndPosition
clearEndPosition
setEndPosition
The position of the last byte within the text.
| Parameter | |
|---|---|
| Name | Description |
var |
TextLocator\Position
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getNestedLocator
If source, start_position, and end_position describe a call on
some object (e.g. a macro in the time series query language text) and a
location is to be designated in that object's text, nested_locator
identifies the location within that object.
| Returns | |
|---|---|
| Type | Description |
TextLocator|null |
|
hasNestedLocator
clearNestedLocator
setNestedLocator
If source, start_position, and end_position describe a call on
some object (e.g. a macro in the time series query language text) and a
location is to be designated in that object's text, nested_locator
identifies the location within that object.
| Parameter | |
|---|---|
| Name | Description |
var |
TextLocator
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getNestingReason
When nested_locator is set, this field gives the reason for the nesting.
Usually, the reason is a macro invocation. In that case, the macro name (including the leading '@') signals the location of the macro call in the text and a macro argument name (including the leading '$') signals the location of the macro argument inside the macro body that got substituted away.
| Returns | |
|---|---|
| Type | Description |
string |
|
setNestingReason
When nested_locator is set, this field gives the reason for the nesting.
Usually, the reason is a macro invocation. In that case, the macro name (including the leading '@') signals the location of the macro call in the text and a macro argument name (including the leading '$') signals the location of the macro argument inside the macro body that got substituted away.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|