code: public function setAttachment($type, $payload)
      {
          $attachment = new Attachment();
  
          $attachment->setType($type);
          $attachment->setPayload($payload);
  
          $this->attachment = $attachment;
      }
docs: Set attachment
  
  @param string $type Type
  @param array $payload Payload