<?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 ReportModels
{
    /**
     * @property \DateTime $startDatetime Start date time of the report
     * @property \DateTime $endDatetime End date time of the report
    */
    public static function createInsightsV2CreateAccountReportRequestTimeRange(array $payload = []): InsightsV2CreateAccountReportRequestTimeRange
    {
        return new InsightsV2CreateAccountReportRequestTimeRange($payload);
    }

    /**
     * @property string $key The name of the filter 'call_state', 'call_direction', 'call_type', 'twilio_regions', 'caller_country_code', 'callee_country_code', 'silent'
     * @property string[] $values List of supported filter values for the field name
    */
    public static function createReportFilter(array $payload = []): ReportFilter
    {
        return new ReportFilter($payload);
    }

    /**
     * @property InsightsV2CreateAccountReportRequestTimeRange $timeRange
     * @property ReportFilter[] $filters
    */
    public static function createInsightsV2CreateAccountReportRequest(array $payload = []): InsightsV2CreateAccountReportRequest
    {
        return new InsightsV2CreateAccountReportRequest($payload);
    }

}

class InsightsV2CreateAccountReportRequestTimeRange implements \JsonSerializable
{
    /**
     * @property \DateTime $startDatetime Start date time of the report
     * @property \DateTime $endDatetime End date time of the report
    */
        protected $startDatetime;
        protected $endDatetime;
    public function __construct(array $payload = []) {
        $this->startDatetime = Values::array_get($payload, 'start_datetime');
        $this->endDatetime = Values::array_get($payload, 'end_datetime');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->startDatetime)) {
            $jsonString['start_datetime'] = $this->startDatetime;
        }
        if (isset($this->endDatetime)) {
            $jsonString['end_datetime'] = $this->endDatetime;
        }
        return $jsonString;
    }
}

class ReportFilter implements \JsonSerializable
{
    /**
     * @property string $key The name of the filter 'call_state', 'call_direction', 'call_type', 'twilio_regions', 'caller_country_code', 'callee_country_code', 'silent'
     * @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 InsightsV2CreateAccountReportRequest implements \JsonSerializable
{
    /**
     * @property InsightsV2CreateAccountReportRequestTimeRange $timeRange
     * @property ReportFilter[] $filters
    */
        protected $timeRange;
        protected $filters;
    public function __construct(array $payload = []) {
        $this->timeRange = Values::array_get($payload, 'time_range');
        $this->filters = Values::array_get($payload, 'filters');
    }

    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;
        }
        return $jsonString;
    }
}

