PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
convertkit / vendor / wordpress / php-mcp-schema / src / Server / Resources / DTO / UnsubscribeRequestParams.php

UnsubscribeRequestParams.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.4.3, at vendor/wordpress/php-mcp-schema/src/Server/Resources/DTO/UnsubscribeRequestParams.php

77 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WP\McpSchema\Server\Resources\DTO;
6
7 use WP\McpSchema\Common\JsonRpc\DTO\RequestParamsMeta;
8 use WP\McpSchema\Common\Traits\ValidatesRequiredFields;
9
10 /**
11 * Parameters for a `resources/unsubscribe` request.
12 *
13 * Note: This class is structurally identical to ResourceRequestParams.
14 * It exists as a separate type for semantic distinction per MCP specification.
15 *
16 * @since 2025-11-25
17 *
18 * @mcp-domain Server
19 * @mcp-subdomain Resources
20 * @mcp-version 2025-11-25
21 * @see ResourceRequestParams
22 */
23 class UnsubscribeRequestParams extends ResourceRequestParams
24 {
25 use ValidatesRequiredFields;
26
27 /**
28 * @param string $uri @since 2025-11-25
29 * @param \WP\McpSchema\Common\JsonRpc\DTO\RequestParamsMeta|null $_meta @since 2025-11-25
30 */
31 public function __construct(
32 string $uri,
33 ?RequestParamsMeta $_meta = null
34 ) {
35 parent::__construct($uri, $_meta);
36 }
37
38 /**
39 * Creates an instance from an array.
40 *
41 * @param array{
42 * uri: string,
43 * _meta?: array<string, mixed>|\WP\McpSchema\Common\JsonRpc\DTO\RequestParamsMeta|null
44 * } $data
45 * @phpstan-param array<string, mixed> $data
46 * @return self
47 */
48 public static function fromArray(array $data): self
49 {
50 self::assertRequired($data, ['uri']);
51
52 /** @var \WP\McpSchema\Common\JsonRpc\DTO\RequestParamsMeta|null $_meta */
53 $_meta = isset($data['_meta'])
54 ? (is_array($data['_meta'])
55 ? RequestParamsMeta::fromArray(self::asArray($data['_meta']))
56 : $data['_meta'])
57 : null;
58
59 return new self(
60 self::asString($data['uri']),
61 $_meta
62 );
63 }
64
65 /**
66 * Converts the instance to an array.
67 *
68 * @return array<string, mixed>
69 */
70 public function toArray(): array
71 {
72 $result = parent::toArray();
73
74 return $result;
75 }
76 }
77