HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/be.naniguide.com/vendor/anthropic-ai/sdk/src/GatewayTimeoutError.php
<?php

declare(strict_types=1);

namespace Anthropic;

use Anthropic\Core\Attributes\Required;
use Anthropic\Core\Concerns\SdkModel;
use Anthropic\Core\Contracts\BaseModel;

/**
 * @phpstan-type GatewayTimeoutErrorShape = array{
 *   message: string, type: 'timeout_error'
 * }
 */
final class GatewayTimeoutError implements BaseModel
{
    /** @use SdkModel<GatewayTimeoutErrorShape> */
    use SdkModel;

    /** @var 'timeout_error' $type */
    #[Required]
    public string $type = 'timeout_error';

    #[Required]
    public string $message;

    /**
     * `new GatewayTimeoutError()` is missing required properties by the API.
     *
     * To enforce required parameters use
     * ```
     * GatewayTimeoutError::with(message: ...)
     * ```
     *
     * Otherwise ensure the following setters are called
     *
     * ```
     * (new GatewayTimeoutError)->withMessage(...)
     * ```
     */
    public function __construct()
    {
        $this->initialize();
    }

    /**
     * Construct an instance from the required parameters.
     *
     * You must use named parameters to construct any parameters with a default value.
     */
    public static function with(string $message = 'Request timeout'): self
    {
        $self = new self;

        $self['message'] = $message;

        return $self;
    }

    public function withMessage(string $message): self
    {
        $self = clone $this;
        $self['message'] = $message;

        return $self;
    }

    /**
     * @param 'timeout_error' $type
     */
    public function withType(string $type): self
    {
        $self = clone $this;
        $self['type'] = $type;

        return $self;
    }
}