EmbeddedResource extends Content
Represents embedded resource content within a message.
Tags
Table of Contents
Properties
- $annotations : Annotations|null
- $resource : TextResourceContents|BlobResourceContents
- $type : string
Methods
- __construct() : mixed
- fromArray() : self
- fromBlob() : self
- fromFile() : self
- fromSplFileInfo() : self
- fromStream() : self
- fromText() : self
- jsonSerialize() : Annotations}
- isTextMimeTypeHeuristic() : bool
Properties
$annotations read-only
public
Annotations|null
$annotations
= null
$resource read-only
public
TextResourceContents|BlobResourceContents
$resource
$type read-only
public
string
$type
Methods
__construct()
public
__construct(TextResourceContents|BlobResourceContents $resource[, Annotations|null $annotations = null ]) : mixed
Parameters
- $resource : TextResourceContents|BlobResourceContents
- $annotations : Annotations|null = null
fromArray()
public
static fromArray(EmbeddedResourceData $data) : self
Parameters
- $data : EmbeddedResourceData
Return values
selffromBlob()
public
static fromBlob(string $uri, string $base64Blob, string $mimeType[, Annotations|null $annotations = null ]) : self
Parameters
- $uri : string
- $base64Blob : string
- $mimeType : string
- $annotations : Annotations|null = null
Return values
selffromFile()
public
static fromFile(string $uri, string $path[, string|null $explicitMimeType = null ][, Annotations|null $annotations = null ]) : self
Parameters
- $uri : string
- $path : string
- $explicitMimeType : string|null = null
- $annotations : Annotations|null = null
Return values
selffromSplFileInfo()
public
static fromSplFileInfo(string $uri, SplFileInfo $file[, string|null $explicitMimeType = null ][, Annotations|null $annotations = null ]) : self
Parameters
- $uri : string
- $file : SplFileInfo
- $explicitMimeType : string|null = null
- $annotations : Annotations|null = null
Return values
selffromStream()
public
static fromStream(string $uri, resource $stream, string $mimeType[, Annotations|null $annotations = null ]) : self
Parameters
- $uri : string
- $stream : resource
- $mimeType : string
- $annotations : Annotations|null = null
Return values
selffromText()
public
static fromText(string $uri, string $text[, string|null $mimeType = 'text/plain' ][, Annotations|null $annotations = null ]) : self
Parameters
- $uri : string
- $text : string
- $mimeType : string|null = 'text/plain'
- $annotations : Annotations|null = null
Return values
selfjsonSerialize()
public
jsonSerialize() : Annotations}
Return values
Annotations}isTextMimeTypeHeuristic()
private
static isTextMimeTypeHeuristic(string $mimeType) : bool
Parameters
- $mimeType : string