brandon14/ebay-sdk-php

View on GitHub
src/Sell/Feed/V1/Model/UpdateUserScheduleRequest.php

Summary

Maintainability
A
3 hrs
Test Coverage
<?php

/**
 * This file is part of the trollandtoad/ebay-sdk-php package.
 *
 * MIT License
 *
 * Copyright (c) 2022 Brandon Clothier
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

declare(strict_types=1);

/**
 * UpdateUserScheduleRequest.
 *
 * PHP version ^7.2 || ^8.0
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Feed API.
 *
 * <p>The <strong>Feed API</strong> lets sellers upload input files, download reports and files including their status, filter reports using URI parameters, and retrieve customer service metrics task details.</p>
 *
 * The version of the OpenAPI document: v1.3.1
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 5.4.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace TNT\Ebay\Sell\Feed\V1\Model;

use TNT\Ebay\Sell\Feed\V1\ObjectSerializer;

/**
 * UpdateUserScheduleRequest Class Doc Comment.
 *
 * @category Class
 *
 * @description The type that defines the fields for a schedule update to a schedule generated with the Feed API.
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<TKey, TValue>
 *
 * @template TKey int|null
 * @template TValue mixed|null
 */
class UpdateUserScheduleRequest implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
     * The original name of the model.
     *
     * @var string
     */
    protected static $openAPIModelName = 'UpdateUserScheduleRequest';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'preferred_trigger_day_of_month' => 'int',
        'preferred_trigger_day_of_week' => 'string',
        'preferred_trigger_hour' => 'string',
        'schedule_end_date' => 'string',
        'schedule_name' => 'string',
        'schedule_start_date' => 'string',
        'schema_version' => 'string',
    ];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     *
     * @phpstan-var array<string, string|null>
     *
     * @psalm-var array<string, string|null>
     */
    protected static $openAPIFormats = [
        'preferred_trigger_day_of_month' => 'int32',
        'preferred_trigger_day_of_week' => null,
        'preferred_trigger_hour' => null,
        'schedule_end_date' => null,
        'schedule_name' => null,
        'schedule_start_date' => null,
        'schema_version' => null,
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'preferred_trigger_day_of_month' => 'preferredTriggerDayOfMonth',
        'preferred_trigger_day_of_week' => 'preferredTriggerDayOfWeek',
        'preferred_trigger_hour' => 'preferredTriggerHour',
        'schedule_end_date' => 'scheduleEndDate',
        'schedule_name' => 'scheduleName',
        'schedule_start_date' => 'scheduleStartDate',
        'schema_version' => 'schemaVersion',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'preferred_trigger_day_of_month' => 'setPreferredTriggerDayOfMonth',
        'preferred_trigger_day_of_week' => 'setPreferredTriggerDayOfWeek',
        'preferred_trigger_hour' => 'setPreferredTriggerHour',
        'schedule_end_date' => 'setScheduleEndDate',
        'schedule_name' => 'setScheduleName',
        'schedule_start_date' => 'setScheduleStartDate',
        'schema_version' => 'setSchemaVersion',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'preferred_trigger_day_of_month' => 'getPreferredTriggerDayOfMonth',
        'preferred_trigger_day_of_week' => 'getPreferredTriggerDayOfWeek',
        'preferred_trigger_hour' => 'getPreferredTriggerHour',
        'schedule_end_date' => 'getScheduleEndDate',
        'schedule_name' => 'getScheduleName',
        'schedule_start_date' => 'getScheduleStartDate',
        'schema_version' => 'getSchemaVersion',
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }

    /**
     * Associative array for storing property values.
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor.
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['preferred_trigger_day_of_month'] = $data['preferred_trigger_day_of_month'] ?? null;
        $this->container['preferred_trigger_day_of_week'] = $data['preferred_trigger_day_of_week'] ?? null;
        $this->container['preferred_trigger_hour'] = $data['preferred_trigger_hour'] ?? null;
        $this->container['schedule_end_date'] = $data['schedule_end_date'] ?? null;
        $this->container['schedule_name'] = $data['schedule_name'] ?? null;
        $this->container['schedule_start_date'] = $data['schedule_start_date'] ?? null;
        $this->container['schema_version'] = $data['schema_version'] ?? null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed.
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }

    /**
     * Gets preferred_trigger_day_of_month.
     *
     * @return int|null
     */
    public function getPreferredTriggerDayOfMonth()
    {
        return $this->container['preferred_trigger_day_of_month'];
    }

    /**
     * Sets preferred_trigger_day_of_month.
     *
     * @param int|null $preferred_trigger_day_of_month The preferred day of the month to trigger the schedule. This field can be used with <strong>preferredTriggerHour</strong> for monthly schedules. The last day of the month is used for numbers larger than the actual number of days in the month. <br /><br />This field is available as specified by the template (<strong>scheduleTemplateId</strong>). The template can specify this field as optional or required, and optionally provides a default value. <br /><br /><b>Minimum: </b>1<b><br /><br /><b>Maximum: </b>31
     *
     * @return self
     */
    public function setPreferredTriggerDayOfMonth($preferred_trigger_day_of_month)
    {
        $this->container['preferred_trigger_day_of_month'] = $preferred_trigger_day_of_month;

        return $this;
    }

    /**
     * Gets preferred_trigger_day_of_week.
     *
     * @return string|null
     */
    public function getPreferredTriggerDayOfWeek()
    {
        return $this->container['preferred_trigger_day_of_week'];
    }

    /**
     * Sets preferred_trigger_day_of_week.
     *
     * @param string|null $preferred_trigger_day_of_week The preferred day of the week to trigger the schedule. This field can be used with <strong>preferredTriggerHour</strong> for weekly schedules. <br /><br />This field is available as specified by the template (<strong>scheduleTemplateId</strong>). The template can specify this field as optional or required, and optionally provides a default value. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/feed/types/api:DayOfWeekEnum'>eBay API documentation</a>
     *
     * @return self
     */
    public function setPreferredTriggerDayOfWeek($preferred_trigger_day_of_week)
    {
        $this->container['preferred_trigger_day_of_week'] = $preferred_trigger_day_of_week;

        return $this;
    }

    /**
     * Gets preferred_trigger_hour.
     *
     * @return string|null
     */
    public function getPreferredTriggerHour()
    {
        return $this->container['preferred_trigger_hour'];
    }

    /**
     * Sets preferred_trigger_hour.
     *
     * @param string|null $preferred_trigger_hour The preferred two-digit hour of the day to trigger the schedule. <br /><br />This field is available as specified by the template (<strong>scheduleTemplateId</strong>). The template can specify this field as optional or required, and optionally provides a default value. <br /><br /><b>Format:</b> UTC <code>hhZ</code><br /><br />For example, the following represents 11:00 am UTC:<code> 11Z</code><br /><br /><b>Minimum: </b><code>00Z</code><b><br /><br /><b>Maximum: </b><code>23Z</code>
     *
     * @return self
     */
    public function setPreferredTriggerHour($preferred_trigger_hour)
    {
        $this->container['preferred_trigger_hour'] = $preferred_trigger_hour;

        return $this;
    }

    /**
     * Gets schedule_end_date.
     *
     * @return string|null
     */
    public function getScheduleEndDate()
    {
        return $this->container['schedule_end_date'];
    }

    /**
     * Sets schedule_end_date.
     *
     * @param string|null $schedule_end_date The timestamp on which the schedule (report generation) ends. After this date, the schedule status becomes <code>INACTIVE</code>. <br /><br />Use this field, if available, to end the schedule in the future. This value must be later than <strong>scheduleStartDate</strong> (if supplied). This field is available as specified by the template (<strong>scheduleTemplateId</strong>). The template can specify this field as optional or required, and optionally provides a default value.<br /><br /><b>Format:</b> UTC <code>yyyy-MM-dd<strong>T</strong>HH<strong>Z</strong></code><br /><br />For example, the following represents UTC October 10, 2021 at 10:00 AM:<br /><code> 2021-10-10T10Z</code>
     *
     * @return self
     */
    public function setScheduleEndDate($schedule_end_date)
    {
        $this->container['schedule_end_date'] = $schedule_end_date;

        return $this;
    }

    /**
     * Gets schedule_name.
     *
     * @return string|null
     */
    public function getScheduleName()
    {
        return $this->container['schedule_name'];
    }

    /**
     * Sets schedule_name.
     *
     * @param string|null $schedule_name the schedule name assigned by the user for the created schedule
     *
     * @return self
     */
    public function setScheduleName($schedule_name)
    {
        $this->container['schedule_name'] = $schedule_name;

        return $this;
    }

    /**
     * Gets schedule_start_date.
     *
     * @return string|null
     */
    public function getScheduleStartDate()
    {
        return $this->container['schedule_start_date'];
    }

    /**
     * Sets schedule_start_date.
     *
     * @param string|null $schedule_start_date The timestamp to start generating the report. After this timestamp, the schedule status becomes active until either the <strong>scheduleEndDate</strong> occurs or the <strong>scheduleTemplateId</strong> becomes inactive. <br /><br />Use this field, if available, to start the schedule in the future but before the <strong>scheduleEndDate</strong> (if supplied). This field is available as specified by the template <strong>(scheduleTemplateId)</strong>.  The template can specify this field as optional or required, and optionally provides a default value.<br /><br /><b>Format:</b> UTC <code>yyyy-MM-dd<strong>T</strong>HH<strong>Z</strong></code><br /><br />For example, the following represents a schedule start date of UTC October 01, 2020 at 12:00 PM:<br /><code> 2020-01-01T12Z</code>
     *
     * @return self
     */
    public function setScheduleStartDate($schedule_start_date)
    {
        $this->container['schedule_start_date'] = $schedule_start_date;

        return $this;
    }

    /**
     * Gets schema_version.
     *
     * @return string|null
     */
    public function getSchemaVersion()
    {
        return $this->container['schema_version'];
    }

    /**
     * Sets schema_version.
     *
     * @param string|null $schema_version The schema version of the feedType for the schedule. This field is required if the <strong>feedType</strong> has a schema version. <br /><br />This field is available as specified by the template (<strong>scheduleTemplateId</strong>). The template can specify this field as optional or required, and optionally provides a default value.
     *
     * @return self
     */
    public function setSchemaVersion($schema_version)
    {
        $this->container['schema_version'] = $schema_version;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, $value): void
    {
        if (null === $offset) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     *
     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed returns data which can be serialized by json_encode(), which is a value
     *               of any type other than a resource
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object.
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object.
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}