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 fieldtextcontains:
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 messagegoogle.monitoring.v3.TextLocator
Namespace
Google \ Cloud \ Monitoring \ V3
Methods
__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 inhttps://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).
Ifsource,start_position, andend_positiondescribe 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_locatoridentifies the location within that object.
↳ nesting_reason
string
Whennested_locatoris 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.
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 inhttps://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 inhttps://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).
Ifsource,start_position, andend_positiondescribe 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_locatoridentifies the location within that object.
Ifsource,start_position, andend_positiondescribe 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_locatoridentifies the location within that object.
Whennested_locatoris 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
Whennested_locatoris 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Monitoring V3 Client - Class TextLocator (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-monitoring/latest/V3.TextLocator)\n- [2.1.1](/php/docs/reference/cloud-monitoring/2.1.1/V3.TextLocator)\n- [2.0.1](/php/docs/reference/cloud-monitoring/2.0.1/V3.TextLocator)\n- [1.12.1](/php/docs/reference/cloud-monitoring/1.12.1/V3.TextLocator)\n- [1.11.1](/php/docs/reference/cloud-monitoring/1.11.1/V3.TextLocator)\n- [1.10.3](/php/docs/reference/cloud-monitoring/1.10.3/V3.TextLocator)\n- [1.9.0](/php/docs/reference/cloud-monitoring/1.9.0/V3.TextLocator)\n- [1.8.0](/php/docs/reference/cloud-monitoring/1.8.0/V3.TextLocator)\n- [1.7.1](/php/docs/reference/cloud-monitoring/1.7.1/V3.TextLocator)\n- [1.6.0](/php/docs/reference/cloud-monitoring/1.6.0/V3.TextLocator)\n- [1.5.1](/php/docs/reference/cloud-monitoring/1.5.1/V3.TextLocator)\n- [1.4.0](/php/docs/reference/cloud-monitoring/1.4.0/V3.TextLocator)\n- [1.3.2](/php/docs/reference/cloud-monitoring/1.3.2/V3.TextLocator)\n- [1.2.2](/php/docs/reference/cloud-monitoring/1.2.2/V3.TextLocator) \nReference documentation and code samples for the Stackdriver Monitoring V3 Client class TextLocator.\n\nA locator for text. Indicates a particular part of the text of a request or\nof an object referenced in the request.\n\nFor example, suppose the request field `text` contains:\ntext: \"The quick brown fox jumps over the lazy dog.\"\nThen the locator:\nsource: \"text\"\nstart_position {\nline: 1\ncolumn: 17\n}\nend_position {\nline: 1\ncolumn: 19\n}\nrefers to the part of the text: \"fox\".\n\nGenerated from protobuf message `google.monitoring.v3.TextLocator`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Monitoring \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSource\n\nThe source of the text. The source may be a field in the request, in which\ncase its format is the format of the\ngoogle.rpc.BadRequest.FieldViolation.field field in\n\u003chttps://cloud.google.com/apis/design/errors#error_details\u003e. It may also be\nbe a source other than the request field (e.g. a macro definition\nreferenced in the text of the query), in which case this is the name of\nthe source (e.g. the macro name).\n\n### setSource\n\nThe source of the text. The source may be a field in the request, in which\ncase its format is the format of the\ngoogle.rpc.BadRequest.FieldViolation.field field in\n\u003chttps://cloud.google.com/apis/design/errors#error_details\u003e. It may also be\nbe a source other than the request field (e.g. a macro definition\nreferenced in the text of the query), in which case this is the name of\nthe source (e.g. the macro name).\n\n### getStartPosition\n\nThe position of the first byte within the text.\n\n### hasStartPosition\n\n### clearStartPosition\n\n### setStartPosition\n\nThe position of the first byte within the text.\n\n### getEndPosition\n\nThe position of the last byte within the text.\n\n### hasEndPosition\n\n### clearEndPosition\n\n### setEndPosition\n\nThe position of the last byte within the text.\n\n### getNestedLocator\n\nIf `source`, `start_position`, and `end_position` describe a call on\nsome object (e.g. a macro in the time series query language text) and a\nlocation is to be designated in that object's text, `nested_locator`\nidentifies the location within that object.\n\n### hasNestedLocator\n\n### clearNestedLocator\n\n### setNestedLocator\n\nIf `source`, `start_position`, and `end_position` describe a call on\nsome object (e.g. a macro in the time series query language text) and a\nlocation is to be designated in that object's text, `nested_locator`\nidentifies the location within that object.\n\n### getNestingReason\n\nWhen `nested_locator` is set, this field gives the reason for the nesting.\n\nUsually, the reason is a macro invocation. In that case, the macro name\n(including the leading '@') signals the location of the macro call\nin the text and a macro argument name (including the leading '$') signals\nthe location of the macro argument inside the macro body that got\nsubstituted away.\n\n### setNestingReason\n\nWhen `nested_locator` is set, this field gives the reason for the nesting.\n\nUsually, the reason is a macro invocation. In that case, the macro name\n(including the leading '@') signals the location of the macro call\nin the text and a macro argument name (including the leading '$') signals\nthe location of the macro argument inside the macro body that got\nsubstituted away."]]