@@ -29,24 +29,53 @@ final class ListBucketsRequest extends Input
2929 */
3030 private $ continuationToken ;
3131
32+ /**
33+ * Limits the response to bucket names that begin with the specified bucket name prefix.
34+ *
35+ * @var string|null
36+ */
37+ private $ prefix ;
38+
39+ /**
40+ * Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services
41+ * Region must be expressed according to the Amazon Web Services Region code, such as `us-west-2` for the US West
42+ * (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints
43+ * [^1].
44+ *
45+ * > Requests made to a Regional endpoint that is different from the `bucket-region` parameter are not supported. For
46+ * > example, if you want to limit the response to your buckets in Region `us-west-2`, the request must be made to an
47+ * > endpoint in Region `us-west-2`.
48+ *
49+ * [^1]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
50+ *
51+ * @var string|null
52+ */
53+ private $ bucketRegion ;
54+
3255 /**
3356 * @param array{
3457 * MaxBuckets?: null|int,
3558 * ContinuationToken?: null|string,
59+ * Prefix?: null|string,
60+ * BucketRegion?: null|string,
3661 * '@region'?: string|null,
3762 * } $input
3863 */
3964 public function __construct (array $ input = [])
4065 {
4166 $ this ->maxBuckets = $ input ['MaxBuckets ' ] ?? null ;
4267 $ this ->continuationToken = $ input ['ContinuationToken ' ] ?? null ;
68+ $ this ->prefix = $ input ['Prefix ' ] ?? null ;
69+ $ this ->bucketRegion = $ input ['BucketRegion ' ] ?? null ;
4370 parent ::__construct ($ input );
4471 }
4572
4673 /**
4774 * @param array{
4875 * MaxBuckets?: null|int,
4976 * ContinuationToken?: null|string,
77+ * Prefix?: null|string,
78+ * BucketRegion?: null|string,
5079 * '@region'?: string|null,
5180 * }|ListBucketsRequest $input
5281 */
@@ -55,6 +84,11 @@ public static function create($input): self
5584 return $ input instanceof self ? $ input : new self ($ input );
5685 }
5786
87+ public function getBucketRegion (): ?string
88+ {
89+ return $ this ->bucketRegion ;
90+ }
91+
5892 public function getContinuationToken (): ?string
5993 {
6094 return $ this ->continuationToken ;
@@ -65,6 +99,11 @@ public function getMaxBuckets(): ?int
6599 return $ this ->maxBuckets ;
66100 }
67101
102+ public function getPrefix (): ?string
103+ {
104+ return $ this ->prefix ;
105+ }
106+
68107 /**
69108 * @internal
70109 */
@@ -81,6 +120,12 @@ public function request(): Request
81120 if (null !== $ this ->continuationToken ) {
82121 $ query ['continuation-token ' ] = $ this ->continuationToken ;
83122 }
123+ if (null !== $ this ->prefix ) {
124+ $ query ['prefix ' ] = $ this ->prefix ;
125+ }
126+ if (null !== $ this ->bucketRegion ) {
127+ $ query ['bucket-region ' ] = $ this ->bucketRegion ;
128+ }
84129
85130 // Prepare URI
86131 $ uriString = '/ ' ;
@@ -92,6 +137,13 @@ public function request(): Request
92137 return new Request ('GET ' , $ uriString , $ query , $ headers , StreamFactory::create ($ body ));
93138 }
94139
140+ public function setBucketRegion (?string $ value ): self
141+ {
142+ $ this ->bucketRegion = $ value ;
143+
144+ return $ this ;
145+ }
146+
95147 public function setContinuationToken (?string $ value ): self
96148 {
97149 $ this ->continuationToken = $ value ;
@@ -105,4 +157,11 @@ public function setMaxBuckets(?int $value): self
105157
106158 return $ this ;
107159 }
160+
161+ public function setPrefix (?string $ value ): self
162+ {
163+ $ this ->prefix = $ value ;
164+
165+ return $ this ;
166+ }
108167}
0 commit comments