<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Sample/reference Twilio API.
 * This is the reference API for the rest-proxy server.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Twilio\Rest\Insights\V2;

use Twilio\Values;
abstract class OutboundModels
{
    /**
     * @property \DateTime $startTime Start time of the report
     * @property \DateTime $endTime End time of the report
    */
    public static function createInsightsV2CreatePhoneNumbersReportRequestTimeRange(array $payload = []): InsightsV2CreatePhoneNumbersReportRequestTimeRange
    {
        return new InsightsV2CreatePhoneNumbersReportRequestTimeRange($payload);
    }

    /**
     * @property string $key The name of the filter
     * @property string[] $values List of supported filter values for the field name
    */
    public static function createPhoneNumberReportFilter(array $payload = []): PhoneNumberReportFilter
    {
        return new PhoneNumberReportFilter($payload);
    }

    /**
     * @property InsightsV2CreatePhoneNumbersReportRequestTimeRange $timeRange
     * @property PhoneNumberReportFilter[] $filters
     * @property int $size The number of max available top Phone Numbers to generate.
    */
    public static function createInsightsV2CreatePhoneNumbersReportRequest(array $payload = []): InsightsV2CreatePhoneNumbersReportRequest
    {
        return new InsightsV2CreatePhoneNumbersReportRequest($payload);
    }

}

class InsightsV2CreatePhoneNumbersReportRequestTimeRange implements \JsonSerializable
{
    /**
     * @property \DateTime $startTime Start time of the report
     * @property \DateTime $endTime End time of the report
    */
        protected $startTime;
        protected $endTime;
    public function __construct(array $payload = []) {
        $this->startTime = Values::array_get($payload, 'start_time');
        $this->endTime = Values::array_get($payload, 'end_time');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->startTime)) {
            $jsonString['start_time'] = $this->startTime;
        }
        if (isset($this->endTime)) {
            $jsonString['end_time'] = $this->endTime;
        }
        return $jsonString;
    }
}

class PhoneNumberReportFilter implements \JsonSerializable
{
    /**
     * @property string $key The name of the filter
     * @property string[] $values List of supported filter values for the field name
    */
        protected $key;
        protected $values;
    public function __construct(array $payload = []) {
        $this->key = Values::array_get($payload, 'key');
        $this->values = Values::array_get($payload, 'values');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->key)) {
            $jsonString['key'] = $this->key;
        }
        if (isset($this->values)) {
            $jsonString['values'] = $this->values;
        }
        return $jsonString;
    }
}

class InsightsV2CreatePhoneNumbersReportRequest implements \JsonSerializable
{
    /**
     * @property InsightsV2CreatePhoneNumbersReportRequestTimeRange $timeRange
     * @property PhoneNumberReportFilter[] $filters
     * @property int $size The number of max available top Phone Numbers to generate.
    */
        protected $timeRange;
        protected $filters;
        protected $size;
    public function __construct(array $payload = []) {
        $this->timeRange = Values::array_get($payload, 'time_range');
        $this->filters = Values::array_get($payload, 'filters');
        $this->size = Values::array_get($payload, 'size');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->timeRange)) {
            $jsonString['time_range'] = $this->timeRange;
        }
        if (isset($this->filters)) {
            $jsonString['filters'] = $this->filters;
        }
        if (isset($this->size)) {
            $jsonString['size'] = $this->size;
        }
        return $jsonString;
    }
}

