<?php
/**
 * AsynchronousOperationsDataOperationInterface
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Magento2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Magento Community
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.3
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.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 Magento2\Model;

use \ArrayAccess;
use \Magento2\ObjectSerializer;

/**
 * AsynchronousOperationsDataOperationInterface Class Doc Comment
 *
 * @category Class
 * @description Class OperationInterface
 * @package  Magento2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class AsynchronousOperationsDataOperationInterface implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'asynchronous-operations-data-operation-interface';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'extension_attributes' => '\Magento2\Model\AsynchronousOperationsDataOperationExtensionInterface',
        'id' => 'int',
        'bulk_uuid' => 'string',
        'topic_name' => 'string',
        'serialized_data' => 'string',
        'result_serialized_data' => 'string',
        'status' => 'int',
        'result_message' => 'string',
        'error_code' => 'int'
    ];

    /**
      * 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 = [
        'extension_attributes' => null,
        'id' => null,
        'bulk_uuid' => null,
        'topic_name' => null,
        'serialized_data' => null,
        'result_serialized_data' => null,
        'status' => null,
        'result_message' => null,
        'error_code' => 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 = [
        'extension_attributes' => 'extension_attributes',
        'id' => 'id',
        'bulk_uuid' => 'bulk_uuid',
        'topic_name' => 'topic_name',
        'serialized_data' => 'serialized_data',
        'result_serialized_data' => 'result_serialized_data',
        'status' => 'status',
        'result_message' => 'result_message',
        'error_code' => 'error_code'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'extension_attributes' => 'setExtensionAttributes',
        'id' => 'setId',
        'bulk_uuid' => 'setBulkUuid',
        'topic_name' => 'setTopicName',
        'serialized_data' => 'setSerializedData',
        'result_serialized_data' => 'setResultSerializedData',
        'status' => 'setStatus',
        'result_message' => 'setResultMessage',
        'error_code' => 'setErrorCode'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'extension_attributes' => 'getExtensionAttributes',
        'id' => 'getId',
        'bulk_uuid' => 'getBulkUuid',
        'topic_name' => 'getTopicName',
        'serialized_data' => 'getSerializedData',
        'result_serialized_data' => 'getResultSerializedData',
        'status' => 'getStatus',
        'result_message' => 'getResultMessage',
        'error_code' => 'getErrorCode'
    ];

    /**
     * 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['extension_attributes'] = $data['extension_attributes'] ?? null;
        $this->container['id'] = $data['id'] ?? null;
        $this->container['bulk_uuid'] = $data['bulk_uuid'] ?? null;
        $this->container['topic_name'] = $data['topic_name'] ?? null;
        $this->container['serialized_data'] = $data['serialized_data'] ?? null;
        $this->container['result_serialized_data'] = $data['result_serialized_data'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['result_message'] = $data['result_message'] ?? null;
        $this->container['error_code'] = $data['error_code'] ?? null;
    }

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

        if ($this->container['id'] === null) {
            $invalidProperties[] = "'id' can't be null";
        }
        if ($this->container['bulk_uuid'] === null) {
            $invalidProperties[] = "'bulk_uuid' can't be null";
        }
        if ($this->container['topic_name'] === null) {
            $invalidProperties[] = "'topic_name' can't be null";
        }
        if ($this->container['serialized_data'] === null) {
            $invalidProperties[] = "'serialized_data' can't be null";
        }
        if ($this->container['result_serialized_data'] === null) {
            $invalidProperties[] = "'result_serialized_data' can't be null";
        }
        if ($this->container['status'] === null) {
            $invalidProperties[] = "'status' can't be null";
        }
        if ($this->container['result_message'] === null) {
            $invalidProperties[] = "'result_message' can't be null";
        }
        if ($this->container['error_code'] === null) {
            $invalidProperties[] = "'error_code' can't be null";
        }
        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 extension_attributes
     *
     * @return \Magento2\Model\AsynchronousOperationsDataOperationExtensionInterface|null
     */
    public function getExtensionAttributes()
    {
        return $this->container['extension_attributes'];
    }

    /**
     * Sets extension_attributes
     *
     * @param \Magento2\Model\AsynchronousOperationsDataOperationExtensionInterface|null $extension_attributes extension_attributes
     *
     * @return self
     */
    public function setExtensionAttributes($extension_attributes)
    {
        $this->container['extension_attributes'] = $extension_attributes;

        return $this;
    }

    /**
     * Gets id
     *
     * @return int
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int $id Id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets bulk_uuid
     *
     * @return string
     */
    public function getBulkUuid()
    {
        return $this->container['bulk_uuid'];
    }

    /**
     * Sets bulk_uuid
     *
     * @param string $bulk_uuid Bulk uuid
     *
     * @return self
     */
    public function setBulkUuid($bulk_uuid)
    {
        $this->container['bulk_uuid'] = $bulk_uuid;

        return $this;
    }

    /**
     * Gets topic_name
     *
     * @return string
     */
    public function getTopicName()
    {
        return $this->container['topic_name'];
    }

    /**
     * Sets topic_name
     *
     * @param string $topic_name Queue Topic
     *
     * @return self
     */
    public function setTopicName($topic_name)
    {
        $this->container['topic_name'] = $topic_name;

        return $this;
    }

    /**
     * Gets serialized_data
     *
     * @return string
     */
    public function getSerializedData()
    {
        return $this->container['serialized_data'];
    }

    /**
     * Sets serialized_data
     *
     * @param string $serialized_data Data
     *
     * @return self
     */
    public function setSerializedData($serialized_data)
    {
        $this->container['serialized_data'] = $serialized_data;

        return $this;
    }

    /**
     * Gets result_serialized_data
     *
     * @return string
     */
    public function getResultSerializedData()
    {
        return $this->container['result_serialized_data'];
    }

    /**
     * Sets result_serialized_data
     *
     * @param string $result_serialized_data Serialized Data
     *
     * @return self
     */
    public function setResultSerializedData($result_serialized_data)
    {
        $this->container['result_serialized_data'] = $result_serialized_data;

        return $this;
    }

    /**
     * Gets status
     *
     * @return int
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status
     *
     * @param int $status Operation status
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

    /**
     * Gets result_message
     *
     * @return string
     */
    public function getResultMessage()
    {
        return $this->container['result_message'];
    }

    /**
     * Sets result_message
     *
     * @param string $result_message Result message
     *
     * @return self
     */
    public function setResultMessage($result_message)
    {
        $this->container['result_message'] = $result_message;

        return $this;
    }

    /**
     * Gets error_code
     *
     * @return int
     */
    public function getErrorCode()
    {
        return $this->container['error_code'];
    }

    /**
     * Sets error_code
     *
     * @param int $error_code Error code
     *
     * @return self
     */
    public function setErrorCode($error_code)
    {
        $this->container['error_code'] = $error_code;

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

    /**
     * Gets offset.
     *
     * @param integer $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
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link 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));
    }
}


