url = $url; $this->device_profile = $device_profile; } /** @param array $payload API boundary payload. */ public static function from_payload( array $payload ): ?self { $url = $payload['url'] ?? null; $profile = $payload['device_profile'] ?? null; if ( ! is_string( $url ) || ! is_string( $profile ) ) { return null; } return new self( $url, $profile ); } /** @return array{url: string, device_profile: string} */ public function to_payload(): array { return array( 'url' => $this->url, 'device_profile' => $this->device_profile, ); } }