Sets the confirmation hash for the action.

@param array $confirmation

@return \Spatie\SlashCommand\AttachmentAction
@throws \Spatie\SlashCommand\Exceptions\InvalidConfirmationHash
14610
public function setConfirmation(array $confirmation)
    {
        if (! array_key_exists('text', $confirmation)) {
            throw InvalidConfirmationHash::missingTextField();
        }

        $this->confirmation = $confirmation;

        return $this;
    }
836948
public function confirmation($message, $choices = ['y' => true, 'n' => false], $default = false)
    {
        return $this->response->confirmation($message, $choices, $default);
    }
329524
public function setAttachments($attachments) {
		$attach = [];
		foreach ((array)$attachments as $name => $fileInfo) {
			if (!is_array($fileInfo)) {
				$fileInfo = ['file' => $fileInfo];
			}
			if (!isset($fileInfo['file'])) {
				if (!isset($fileInfo['data'])) {
					throw new InvalidArgumentException('No file or data specified.');
				}
				if (is_int($name)) {
					throw new InvalidArgumentException('No filename specified.');
				}
			} else {
				$fileName = $fileInfo['file'];
				if (!preg_match('~^https?://~i', $fileInfo['file'])) {
					$fileInfo['file'] = realpath($fileInfo['file']);
				}
				if ($fileInfo['file'] === false || !Utility::fileExists($fileInfo['file'])) {
					throw new InvalidArgumentException(sprintf('File not found: "%s"', $fileName));
				}
				if (is_int($name)) {
					$name = basename($fileInfo['file']);
				}
			}
			if (!isset($fileInfo['mimetype'])) {
				$ext = pathinfo($name, PATHINFO_EXTENSION);
				$fileInfo['mimetype'] = $this->_getMimeByExtension($ext);
			}
			$attach[$name] = $fileInfo;
		}
		$this->_attachments = $attach;

		return $this;
	}
177287
public function setAttachments($attachments)
    {
        $this->removeAttachments();

        if (is_array($attachments)) {
            foreach ($attachments as $attachment) {
                $this->addAttachment($attachment);
            }
        }

        return $this;
    }
607643
public static function validateMethod($confirmation, $positive, $negative)
    {
        $lowercase = \strtolower($confirmation);
        if ($positive === $lowercase || $negative === $lowercase) {
            return $lowercase;
        }

        return false;
    }
1133036
public function withAttachments($attachments)
    {
        if (! is_array($attachments)) {
            $attachments = [$attachments];
        }

        foreach ($attachments as $attachment) {
            $this->withAttachment($attachment);
        }

        return $this;
    }
821472
public function setRevision($revision)
    {
        if (!in_array((int) $revision, self::REVISION)) {
            throw new InvalidArgumentException(sprintf(
                'The value "%s" is not a recognized revision number. Allowed revisions are: %s',
                $revision,
                implode(', ', self::REVISION)
            ));
        }
        $this->revision = (int) $revision;

        return $this;
    }
1175696
function setHash($a1hash)
    {
        $a1hash = (string) $a1hash;
        if (strlen($a1hash) !== 32)
            // MD5 hash error
            throw new \InvalidArgumentException(sprintf('The A1 Hash (%s) seems is invalid.', $a1hash));
        
        $this->hash = $a1hash;
        return $this;
    }
466191
public function addAttachment($attachment): Letter
    {
        if (!is_file($attachment)) {
            throw new InvalidArgumentException('"%s" can not be found or is not a file');
        }

        $this->attachments[] = $attachment;

        return $this;
    }
50216
protected function prepareAttachment($mosaic)
    {
        if ($mosaic instanceof MosaicAttachment) {
            return $mosaic;
        }
        elseif ($mosaic instanceof MosaicAttachments) {
            return $mosaic->shift();
        }
        elseif ($mosaic instanceof Mosaic) {
            return new MosaicAttachment(["mosaicId" => $mosaic->toDTO()]);
        }
        elseif ($mosaic instanceof MosaicDefinition) {
            return new MosaicAttachment(["mosaicId" => $mosaic->id()->toDTO()]);
        }
        elseif (is_string($mosaic)) {
            return $this->prepareAttachment(Mosaic::create($mosaic));
        }

        throw new InvalidArgumentException("Unrecognized mosaic parameter type passed to \\NEM\\Models\\Transaction\\MosaicTransfer::attachMosaic().");
    }
39866
public function &createAction(string $type, string $text, string $href = '', bool $ajax = false, string $confirm = ''): Action
    {
        $action = new Action();

        $action->setType($type);
        $action->setText($text);

        if (!empty($href)) {
            $action->setHref($href);
        }

        $action->setAjax($ajax);

        if (!empty($confirm)) {
            $action->setConfirm('confirm');
        }

        $this->addAction($action);

        return $action;
    }
731127
function setHashEncoding($hashAlgorithm)
    {
        $hashAlgorithm = strtolower($hashAlgorithm);
        if ($hashAlgorithm != 'md5' && $hashAlgorithm != 'sha1') {
            throw new InvalidArgumentException("Invalid hash algorithim: '$hashAlgorithm'.");
        }

        $this->manifest->setHashEncoding($hashAlgorithm);
        if ($this->tagManifest !== null) {
            $this->tagManifest->setHashEncoding($hashAlgorithm);
        }
    }
678329
public function setSuccess($success=NULL) {
		$status = 'OK';

		if(isset($success) && $success !== TRUE) {
			$status = 'FAILED';
		}
		$this->setData('status', $status);
		return $success;
	}
763876
public function setHash($hash)
    {
        if (!is_string($hash)) {
            throw new \InvalidArgumentException(
                'An invalid $hash was passed to Identicon. ' .
                'A binary string was expected.');
        }
        if (strlen($hash) < 6) {
            throw new \InvalidArgumentException(
                'An invalid $hash was passed to Identicon. ' . 
                'The hash was expected to contain at least 6 bytes.');
        }
        
        $this->hash = $hash;
        $this->value = null;
        $this->valueSet = false;
        return $this;
    }
867136
protected function resetConfirmation()
    {
        $contentAttribute = $this->contentAttribute;
        if (!$contentAttribute || empty($contentAttribute)) {
            return;
        }
        if (is_array($contentAttribute)) {
            foreach ($contentAttribute as $attribute) {
                if ($this->isAttributeChanged($attribute)) {
                    $this->confirmation = static::$confirmFalse;
                    break;
                }
            }
        } elseif ($this->isAttributeChanged($contentAttribute)) {
            $this->confirmation = static::$confirmFalse;
        }
    }
223834
public function lastUpdateDate(string $hash, ?string $context, bool $confirmed = true)
    {
        $qb = $this->getQuery($hash, $context, $confirmed)->select('a.modified');

        $date = $qb->getQuery()->getSingleResult()['modified'];
        return $date;
    }
1083936
public function setAttachables(array $attachables)
    {
        foreach ($attachables as $attType => $attStruct) {
            if (!is_array($attStruct)) {
                throw new InvalidArgumentException(sprintf(
                    'The attachment structure for "%s" must be an array',
                    $attType
                ));
            }

            if (isset($attStruct['attachment_type'])) {
                $attType = $attStruct['attachment_type'];
            } else {
                $attStruct['attachment_type'] = $attType;
            }

            if (!is_string($attType)) {
                throw new InvalidArgumentException(
                    'The attachment type must be a string'
                );
            }

            $this->attachables[$attType] = $attStruct;
        }

        return $this;
    }