Amazon AWS SDK Installationsanleitung Seite 49

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 151
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 48
echo "Results received. {$requestCount} request(s) made so far.\n";
});
foreach ($iterator as $object) {
echo $object['Key'] . "\n";
}
Modeled Responses
Introduction
The result of a performing an operation is what we refer to as a modeled response. Instead of returning the raw
XML or JSON data, the SDK will coerce the data into an associative array and normalize some aspects of the data
based on its knowledge of the specific service and the underlying response structure.
The actual value returned is a Model (Guzzle\Service\Resource\Model) object. The Model class is a part of
the SDK's underlying Guzzle library, but you do not need to know anything about Guzzle to use your operation
results. The Model object contains the data from the response and can be used like an array (e.g.,
$result['Table']). It also has convenience methods like get(), getPath(), and toArray(). The contents of
the modeled response depend on the operation that was executed and are documented in the API docs for each
operation (e.g., see the Returns section in the API docs for the DynamoDB DescribeTable operation).
$result = $dynamoDbClient->describeTable(array(
'TableName' => 'YourTableName',
));
// Get a specific value from the result
$table = $result['Table'];
if ($table && isset($table['TableStatus'])) {
echo $table['TableStatus'];
}
//> ACTIVE
// Get nested values from the result easily
echo $result->getPath('Table/TableStatus');
//> ACTIVE
// Convert the Model to a plain array
var_export($result->toArray());
//> array ( 'Table' => array ( 'AttributeDefinitions' => array ( ... ) ... ) ... )
Working with Model objects
Model objects (and Command objects) inherit from the Guzzle Collection class and implement PHP's native
ArrayAccess, IteratorAggregate, and Countable interfaces. This means that they behave like arrays when
you are accessing keys and iterating over key-value pairs. You can also use the toArray() method of the Model
object to get the array form directly.
However, model objects will not throw errors on undefined keys, so it's safe to use values directly without doing
isset() checks. It the key doesn't exist, then the value will be returned as null.
// Use an instance of S3Client to get an object
$result = $s3Client->getObject(array(
'Bucket' => 'my-bucket',
'Key' => 'test.txt'
));
// Using a value that may not exist
if (!$result['ContentLength']) {
echo "Empty file.";
Modeled Responses
37
Seitenansicht 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 ... 150 151

Kommentare zu diesen Handbüchern

Keine Kommentare

Electrolux GK56P PL.3 CN manuals

Owner’s manuals and user’s guides for Unknown Electrolux GK56P PL.3 CN.
We providing 2 pdf manuals Electrolux GK56P PL.3 CN for download free by document types: User Manual






More products and manuals for Unknown Electrolux

Models Document Type
EBSL6GTC.4CN User Manual   Electrolux EBSL6TC.4SW Manuale utente, 40 pages
GK56PCN User Manual   Electrolux GK56PCN Manuel utilisateur [fr] , 16 pages
EVE677SA Recipe Book   Electrolux EVE676BA Recipe Book, 16 pages
FR63X User Manual   Electrolux FR63X User Manual [de] [en] [fr] [it] , 24 pages
GK78CRO User Manual Electrolux GK78CRO Brugermanual, 20 pages
EBL40SW User Manual   Electrolux EBL40WE Manuale utente [fr] , 36 pages
EOC6697X User Manual   Electrolux EOC6697X Ohjekirja, 60 pages
ZB 250 User Manual     Electrolux SPIRIT3000 Brugermanual [en] , 15 pages
ESF4510LOX User Manual Electrolux ESF4510LOX User Manual, 20 pages
EWF1297HDW User Manual    Electrolux EWF1297HDW Használati utasítás, 56 pages
EWF10679W User Manual     Electrolux EWF10679W Korisnički priručnik, 88 pages
EBGL7GSP User Manual   Electrolux EBGL7GWE Manuale utente, 32 pages
GK78TSIPCN User Manual   Electrolux GK78TSIPCN Manuale utente [fr] , 28 pages
EBGL70CN User Manual   Electrolux EBGL70WE Manuel utilisateur [da] [sv] , 32 pages
ESF4600ROX User Manual   Electrolux ESF4600ROX Manuali i perdoruesit [en] , 20 pages
EEC5750AOX User Manual   Electrolux EEC5750AOX Manuali i perdoruesit [de] [en] , 40 pages
EOB3637WELUXSPAIN User Manual    Electrolux EOB3637XELUXSPAIN Manual de usuario, 48 pages
EBSL7WE User Manual   Electrolux EBSL7WE Manuel utilisateur, 40 pages
GK80VarioPlusCN User Manual   Electrolux GK80VarioPlusCN Manuel utilisateur [it] , 19 pages
EFT604X User Manual   Electrolux EFT604X Benutzerhandbuch [de] , 11 pages