<?php


namespace App\Libs\Push\HuaWei\Admin\Msg\WebPush;


class WebPushConfig
{
    private $headers;

    private $data;

    private $notification;

    private $hms_options;

    private $fields;

    public function __construct()
    {
        $this->headers      = array();
        $this->notification = array();
        $this->hmsOptions   = array();
        $this->fields       = array();
    }

    public function headers($value)
    {
        $this->headers = $value;
    }

    public function data($value)
    {
        $this->data = $value;
    }

    public function notification($value)
    {
        $this->notification = $value;
    }

    public function hmsOptions($value)
    {
        $this->hms_options = $value;
    }

    public function getFields()
    {
        return $this->fields;
    }

    public function buildFields()
    {
        $keys = array(
            'headers',
            'data',
            'notification',
            'hms_options'
        );
        foreach ($keys as $key) {
            if (isset($this->$key)) {
                $this->fields[$key] = $this->$key;
            }
        }
    }
}