RemoteApiResponse
ClassClass in the Lens Scripting API.
- Available on all platforms
Since Lens Scripting v164
Index
Extends
Properties
body
readonlybody:string
Since
Lens Scripting Version 164
metadata
readonlymetadata:object
Index Signature
[key: string]: string
Since
Lens Scripting Version 164
statusCode
readonlystatusCode:number
The integer status code of the response.
The meaning of possible status code values are defined as follows:
- 1: Success. This code corresponds to the 2XX HTTP response status codes.
- 2: Redirected. This code corresponds to the 3XX HTTP response status codes.
- 3: Bad request. This code corresponds to the 4XX HTTP response status codes other than 401, 403, 404, 408, 413, 414, and 431 which are mapped separately below.
- 4: Access denied. This code corresponds to the HTTP response status codes 401 and 403.
- 5: Not found. This code corresponds to the HTTP response status code 404. It is also returned when the API spec is not found by the remote API service.
- 6: Timeout. This code corresponds to the HTTP response status codes 408 and 504.
- 7: Request too large. This code corresponds to the HTTP response status codes 413, 414, and 431.
- 8: Server error. This code corresponds to the 5XX HTTP response status codes other than 504 (timeout).
- 9: Request cancelled by the caller.
- 10: Internal error happened inside the remote API framework (i.e., not from the remote service being called).
- 11: Rate limited. The request was rejected due to rate limiting.
All other values have undefined meaning and should be treated as internal error (code 10).
Since
Lens Scripting Version 164
uriResources
readonlyuriResources:DynamicResource[]
Since
Lens Scripting Version 278
Methods
asResource()
asResource():
DynamicResource
Converts the response into a DynamicResource object, which can be used by RemoteMediaModule to load the media content in the response body.
Returns
Since
Lens Scripting Version 179
getTypeName()
staticgetTypeName():TypeName<RemoteApiResponse>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<RemoteApiResponse>
Since
Lens Scripting Version 164
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean