<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2024 Sebastian Krupinski <krupinski01@gmail.com>
 * SPDX-License-Identifier: AGPL-3.0-only
 */

namespace JmapClient\Requests\Blob;

use JmapClient\Requests\RequestParameters;

class BlobParameters extends RequestParameters
{
    public function __construct(&$parameters = null)
    {
        parent::__construct($parameters);
    }

    public function type(string $value): static
    {
        $this->parameter('type', $value);
        return $this;
    }

    public function dataPlain(string $value): static
    {
        $this->parameterStructured('data', 'data:asText', $value);
        return $this;
    }

    public function dataEncoded(string $value): static
    {
        $this->parameterStructured('data', 'data:asBase64', $value);
        return $this;
    }
}
