|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace bunq\Model\Generated\Endpoint; |
| 4 | + |
| 5 | +use bunq\Http\ApiClient; |
| 6 | +use bunq\Http\BunqResponse; |
| 7 | +use bunq\Model\Core\BunqModel; |
| 8 | + |
| 9 | +/** |
| 10 | + * Fetch the raw content of a monetary account attachment with given ID. The |
| 11 | + * raw content is the binary representation of a file, without any JSON |
| 12 | + * wrapping. |
| 13 | + * |
| 14 | + * @generated |
| 15 | + */ |
| 16 | +class AttachmentMonetaryAccountContent extends BunqModel |
| 17 | +{ |
| 18 | + /** |
| 19 | + * Endpoint constants. |
| 20 | + */ |
| 21 | + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/attachment/%s/content'; |
| 22 | + |
| 23 | + /** |
| 24 | + * Object type. |
| 25 | + */ |
| 26 | + const OBJECT_TYPE_GET = 'AttachmentMonetaryAccountContent'; |
| 27 | + |
| 28 | + /** |
| 29 | + * Get the raw content of a specific attachment. |
| 30 | + * |
| 31 | + * This method is called "listing" because "list" is a restricted PHP word |
| 32 | + * and cannot be used as constants, class names, function or method names. |
| 33 | + * |
| 34 | + * @param int $attachmentId |
| 35 | + * @param int|null $monetaryAccountId |
| 36 | + * @param string[] $customHeaders |
| 37 | + * |
| 38 | + * @return BunqResponseString |
| 39 | + */ |
| 40 | + public static function listing( |
| 41 | + int $attachmentId, |
| 42 | + int $monetaryAccountId = null, |
| 43 | + array $customHeaders = [] |
| 44 | + ): BunqResponseString { |
| 45 | + $apiClient = new ApiClient(static::getApiContext()); |
| 46 | + $responseRaw = $apiClient->get( |
| 47 | + vsprintf( |
| 48 | + self::ENDPOINT_URL_LISTING, |
| 49 | + [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId), $attachmentId] |
| 50 | + ), |
| 51 | + [], |
| 52 | + $customHeaders |
| 53 | + ); |
| 54 | + |
| 55 | + return BunqResponseString::castFromBunqResponse( |
| 56 | + new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) |
| 57 | + ); |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * @return bool |
| 62 | + */ |
| 63 | + public function isAllFieldNull() |
| 64 | + { |
| 65 | + return true; |
| 66 | + } |
| 67 | +} |
0 commit comments