Skip to content

Commit bf83a53

Browse files
authored
chore: add dev guide examples to applicable client docs (#3192)
1 parent e9253cf commit bf83a53

File tree

4 files changed

+149
-2
lines changed

4 files changed

+149
-2
lines changed

build/docs/classes/DocsBuilder.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,19 @@ private function updateClients(array $services)
415415
$latest = '';
416416
}
417417
$html .= '</ul></article>';
418+
419+
// Add Examples (from the developer guide) section, where applicable
420+
$serviceExamples = require __DIR__ . '/../config/dev-guide-service-examples.php';
421+
if (isset($serviceExamples[$service->name])) {
422+
$html .= '<h2>Examples</h2>';
423+
$html .= '<p>The following examples demonstrate how to use this service with the AWS SDK for PHP. These code examples are available in the <a href="' . $serviceExamples[$service->name]['landing_page'] . '">AWS SDK for PHP Developer Guide</a>.</p>';
424+
$html .= '<ul>';
425+
foreach ($serviceExamples[$service->name]['scenarios'] as $title => $link) {
426+
$html .= sprintf('<li><a href="%s">%s</a></li>', $link, $title);
427+
}
428+
$html .= '</ul>';
429+
}
430+
418431
$this->replaceInner($service->clientLink, $html, '<!-- api -->');
419432
}
420433
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?php
2+
3+
return [
4+
'cloudfront' => [
5+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cf-examples.html',
6+
'scenarios' => [
7+
'Managing CloudFront Distributions' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cloudfront-example-distribution.html',
8+
'Managing CloudFront Invalidations' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cloudfront-example-invalidation.html',
9+
'Signing CloudFront URLs' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cloudfront-example-signed-url.html'
10+
]
11+
],
12+
'cloudsearch' => [
13+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/service_cloudsearch-custom-requests.html',
14+
'scenarios' => [
15+
'Signing custom Amazon CloudSearch domain requests' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/service_cloudsearch-custom-requests.html'
16+
]
17+
],
18+
'monitoring' => [
19+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples.html',
20+
'scenarios' => [
21+
'Working with Amazon CloudWatch alarms' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-work-with-alarms.html',
22+
'Getting metrics from CloudWatch' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-getting-metrics.html',
23+
'Publishing custom metrics in Amazon CloudWatch' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-publishing-custom-metrics.html',
24+
'Sending events to Amazon CloudWatch events' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-sending-events.html',
25+
'Using alarm actions with Amazon CloudWatch alarms' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/cw-examples-using-alarm-actions.html'
26+
]
27+
],
28+
'ec2' => [
29+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples.html',
30+
'scenarios' => [
31+
'Managing Amazon EC2 instances' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-managing-instances.html',
32+
'Using Elastic IP addresses' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-using-elastic-ip-addresses.html',
33+
'Using regions and availability zones' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-using-regions-and-zones.html',
34+
'Working with key pairs' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-working-with-key-pairs.html',
35+
'Working with security groups' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-using-security-groups.html'
36+
]
37+
],
38+
'opensearch' => [
39+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/service_es-data-plane.html',
40+
'scenarios' => [
41+
'Signing an Amazon OpenSearch Service search request' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/service_es-data-plane.html'
42+
]
43+
],
44+
'iam' => [
45+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples.html',
46+
'scenarios' => [
47+
'Managing IAM access keys' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples-managing-access-keys.html',
48+
'Managing IAM users' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples-managing-users.html',
49+
'Using IAM account aliases' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples-using-account-aliases.html',
50+
'Working with IAM policies' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples-working-with-policies.html',
51+
'Working with IAM server certificates' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/iam-examples-working-with-certs.html'
52+
]
53+
],
54+
'kms' => [
55+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-examples.html',
56+
'scenarios' => [
57+
'Working with keys' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-example-keys.html',
58+
'Encrypting and decrypting data keys' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-example-encrypt.html',
59+
'Working with key policies' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-example-key-policy.html',
60+
'Working with grants' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-example-grants.html',
61+
'Working with aliases' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kms-example-alias.html'
62+
]
63+
],
64+
'kinesis' => [
65+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kinesis-examples.html',
66+
'scenarios' => [
67+
'Kinesis data streams' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kinesis-example-data-stream.html',
68+
'Kinesis shards' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kinesis-example-shard.html',
69+
'Kinesis Data Firehose delivery streams' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kinesis-firehose-example-delivery-stream.html'
70+
]
71+
],
72+
'mediaconvert' => [
73+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/emc-examples.html',
74+
'scenarios' => [
75+
'Create and manage transcoding jobs in AWS Elemental MediaConvert' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/emc-examples.html'
76+
]
77+
],
78+
's3' => [
79+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples.html',
80+
'scenarios' => [
81+
'Creating and using Amazon S3 buckets' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-creating-buckets.html',
82+
'Managing Amazon S3 bucket access permissions' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-access-permissions.html',
83+
'Configuring Amazon S3 buckets' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-configuring-a-bucket.html',
84+
'Amazon S3 multipart uploads' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-multipart-upload.html',
85+
'Amazon S3 pre-signed URL' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-presigned-url.html',
86+
'Creating S3 pre-signed POSTs' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-presigned-post.html',
87+
'Using an Amazon S3 bucket as a static web host' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-static-web-host.html',
88+
'Working with Amazon S3 bucket policies' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-bucket-policies.html',
89+
'Using S3 access point ARNs' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-access-point-arn.html',
90+
'Use Multi-Region Access Points' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-multi-region-access-points.html'
91+
]
92+
],
93+
'secretsmanager' => [
94+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/secretsmanager-examples-manage-secret.html',
95+
'scenarios' => [
96+
'Managing secrets using the Secrets Manager API' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/secretsmanager-examples-manage-secret.html'
97+
]
98+
],
99+
'email' => [
100+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-examples.html',
101+
'scenarios' => [
102+
'Verifying email addresses' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-verify.html',
103+
'Working with email templates' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-template.html',
104+
'Managing email filters' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-filters.html',
105+
'Using email rules' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-rules.html',
106+
'Monitor your sending activity' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-send-email.html',
107+
'Authorizing senders' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-sender-policy.html'
108+
]
109+
],
110+
'sns' => [
111+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sns-examples.html',
112+
'scenarios' => [
113+
'Managing topics' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sns-examples-managing-topics.html',
114+
'Managing subscriptions' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sns-examples-subscribing-unsubscribing-topics.html',
115+
'Sending amazon SMS messages' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sns-examples-sending-sms.html'
116+
]
117+
],
118+
'sqs' => [
119+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples.html',
120+
'scenarios' => [
121+
'Enabling long polling' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples-enable-long-polling.html',
122+
'Managing visibility timeout' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples-managing-visibility-timeout.html',
123+
'Sending and receiving messages' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples-send-receive-messages.html',
124+
'Using dead-letter queues' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples-dead-letter-queues.html',
125+
'Using queues' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/sqs-examples-using-queues.html'
126+
]
127+
],
128+
'eventbridge' => [
129+
'landing_page' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/eventbridge-examples.html',
130+
'scenarios' => [
131+
'Send events to Amazon EventBridge global endpoints' => 'https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/eventbridge-examples.html'
132+
]
133+
]
134+
];

src/Ec2/Ec2Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Aws\PresignUrlMiddleware;
99

1010
/**
11-
* Client used to interact with Amazon EC2.
11+
* Client used to interact with **Amazon EC2**.
1212
*
1313
* @method \Aws\Result acceptVpcPeeringConnection(array $args = [])
1414
* @method \GuzzleHttp\Promise\Promise acceptVpcPeeringConnectionAsync(array $args = [])

src/Sqs/SqsClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Psr\Http\Message\RequestInterface;
1010

1111
/**
12-
* Client used to interact Amazon Simple Queue Service (Amazon SQS)
12+
* Client used to interact with **Amazon Simple Queue Service (Amazon SQS)**.
1313
*
1414
* @method \Aws\Result addPermission(array $args = [])
1515
* @method \GuzzleHttp\Promise\Promise addPermissionAsync(array $args = [])

0 commit comments

Comments
 (0)