-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
8,717 additions
and
187 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
<?php | ||
namespace bunq\Model\Generated\Endpoint; | ||
|
||
use bunq\Http\ApiClient; | ||
use bunq\Model\Core\BunqModel; | ||
use bunq\Model\Generated\Object\Attachment; | ||
|
||
/** | ||
* This call is used to upload an attachment that is accessible only by a | ||
* specific user. This can be used for example to upload passport scans or | ||
* other documents. Attachments supported are png, jpg and gif. | ||
* | ||
* @generated | ||
*/ | ||
class AttachmentUser extends BunqModel | ||
{ | ||
/** | ||
* Endpoint constants. | ||
*/ | ||
const ENDPOINT_URL_READ = 'user/%s/attachment/%s'; | ||
|
||
/** | ||
* Object type. | ||
*/ | ||
const OBJECT_TYPE_GET = 'AttachmentUser'; | ||
|
||
/** | ||
* The id of the attachment. | ||
* | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* The timestamp of the attachment's creation. | ||
* | ||
* @var string | ||
*/ | ||
protected $created; | ||
|
||
/** | ||
* The timestamp of the attachment's last update. | ||
* | ||
* @var string | ||
*/ | ||
protected $updated; | ||
|
||
/** | ||
* The attachment. | ||
* | ||
* @var Attachment | ||
*/ | ||
protected $attachment; | ||
|
||
/** | ||
* Get a specific attachment. The header of the response contains the | ||
* content-type of the attachment. | ||
* | ||
* @param int $attachmentUserId | ||
* @param string[] $customHeaders | ||
* | ||
* @return BunqResponseAttachmentUser | ||
*/ | ||
public static function get(int $attachmentUserId, array $customHeaders = []): BunqResponseAttachmentUser | ||
{ | ||
$apiClient = new ApiClient(static::getApiContext()); | ||
$responseRaw = $apiClient->get( | ||
vsprintf( | ||
self::ENDPOINT_URL_READ, | ||
[static::determineUserId(), $attachmentUserId] | ||
), | ||
[], | ||
$customHeaders | ||
); | ||
|
||
return BunqResponseAttachmentUser::castFromBunqResponse( | ||
static::fromJson($responseRaw) | ||
); | ||
} | ||
|
||
/** | ||
* The id of the attachment. | ||
* | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @deprecated User should not be able to set values via setters, use | ||
* constructor. | ||
* | ||
* @param int $id | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
/** | ||
* The timestamp of the attachment's creation. | ||
* | ||
* @return string | ||
*/ | ||
public function getCreated() | ||
{ | ||
return $this->created; | ||
} | ||
|
||
/** | ||
* @deprecated User should not be able to set values via setters, use | ||
* constructor. | ||
* | ||
* @param string $created | ||
*/ | ||
public function setCreated($created) | ||
{ | ||
$this->created = $created; | ||
} | ||
|
||
/** | ||
* The timestamp of the attachment's last update. | ||
* | ||
* @return string | ||
*/ | ||
public function getUpdated() | ||
{ | ||
return $this->updated; | ||
} | ||
|
||
/** | ||
* @deprecated User should not be able to set values via setters, use | ||
* constructor. | ||
* | ||
* @param string $updated | ||
*/ | ||
public function setUpdated($updated) | ||
{ | ||
$this->updated = $updated; | ||
} | ||
|
||
/** | ||
* The attachment. | ||
* | ||
* @return Attachment | ||
*/ | ||
public function getAttachment() | ||
{ | ||
return $this->attachment; | ||
} | ||
|
||
/** | ||
* @deprecated User should not be able to set values via setters, use | ||
* constructor. | ||
* | ||
* @param Attachment $attachment | ||
*/ | ||
public function setAttachment($attachment) | ||
{ | ||
$this->attachment = $attachment; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isAllFieldNull() | ||
{ | ||
if (!is_null($this->id)) { | ||
return false; | ||
} | ||
|
||
if (!is_null($this->created)) { | ||
return false; | ||
} | ||
|
||
if (!is_null($this->updated)) { | ||
return false; | ||
} | ||
|
||
if (!is_null($this->attachment)) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.