<?php
/**
 * UrlMapping
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  HubSpot\Client\Cms\UrlRedirects
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * URL redirects
 *
 * URL redirect operations
 *
 * The version of the OpenAPI document: v3
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.1-SNAPSHOT
 */

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

namespace HubSpot\Client\Cms\UrlRedirects\Model;

use \ArrayAccess;
use \HubSpot\Client\Cms\UrlRedirects\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'portal_id' => 'int',
        'created' => 'int',
        'updated' => 'int',
        'created_by_id' => 'int',
        'updated_by_id' => 'int',
        'route_prefix' => 'string',
        'destination' => 'string',
        'redirect_style' => 'int',
        'content_group_id' => 'int',
        'is_only_after_not_found' => 'bool',
        'is_regex' => 'bool',
        'is_match_full_url' => 'bool',
        'is_match_query_string' => 'bool',
        'is_pattern' => 'bool',
        'is_trailing_slash_optional' => 'bool',
        'is_protocol_agnostic' => 'bool',
        'name' => 'string',
        'precedence' => 'int',
        'deleted_at' => 'int',
        'note' => 'string',
        'label' => 'string',
        'internally_created' => 'bool',
        'cos_object_type' => 'string',
        'cdn_purge_embargo_time' => '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 = [
        'id' => 'int64',
        'portal_id' => 'int32',
        'created' => 'int64',
        'updated' => 'int64',
        'created_by_id' => 'int32',
        'updated_by_id' => 'int32',
        'route_prefix' => null,
        'destination' => null,
        'redirect_style' => 'int32',
        'content_group_id' => 'int64',
        'is_only_after_not_found' => null,
        'is_regex' => null,
        'is_match_full_url' => null,
        'is_match_query_string' => null,
        'is_pattern' => null,
        'is_trailing_slash_optional' => null,
        'is_protocol_agnostic' => null,
        'name' => null,
        'precedence' => 'int32',
        'deleted_at' => 'int64',
        'note' => null,
        'label' => null,
        'internally_created' => null,
        'cos_object_type' => null,
        'cdn_purge_embargo_time' => 'int64'
    ];

    /**
     * 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 = [
        'id' => 'id',
        'portal_id' => 'portalId',
        'created' => 'created',
        'updated' => 'updated',
        'created_by_id' => 'createdById',
        'updated_by_id' => 'updatedById',
        'route_prefix' => 'routePrefix',
        'destination' => 'destination',
        'redirect_style' => 'redirectStyle',
        'content_group_id' => 'contentGroupId',
        'is_only_after_not_found' => 'isOnlyAfterNotFound',
        'is_regex' => 'isRegex',
        'is_match_full_url' => 'isMatchFullUrl',
        'is_match_query_string' => 'isMatchQueryString',
        'is_pattern' => 'isPattern',
        'is_trailing_slash_optional' => 'isTrailingSlashOptional',
        'is_protocol_agnostic' => 'isProtocolAgnostic',
        'name' => 'name',
        'precedence' => 'precedence',
        'deleted_at' => 'deletedAt',
        'note' => 'note',
        'label' => 'label',
        'internally_created' => 'internallyCreated',
        'cos_object_type' => 'cosObjectType',
        'cdn_purge_embargo_time' => 'cdnPurgeEmbargoTime'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'portal_id' => 'setPortalId',
        'created' => 'setCreated',
        'updated' => 'setUpdated',
        'created_by_id' => 'setCreatedById',
        'updated_by_id' => 'setUpdatedById',
        'route_prefix' => 'setRoutePrefix',
        'destination' => 'setDestination',
        'redirect_style' => 'setRedirectStyle',
        'content_group_id' => 'setContentGroupId',
        'is_only_after_not_found' => 'setIsOnlyAfterNotFound',
        'is_regex' => 'setIsRegex',
        'is_match_full_url' => 'setIsMatchFullUrl',
        'is_match_query_string' => 'setIsMatchQueryString',
        'is_pattern' => 'setIsPattern',
        'is_trailing_slash_optional' => 'setIsTrailingSlashOptional',
        'is_protocol_agnostic' => 'setIsProtocolAgnostic',
        'name' => 'setName',
        'precedence' => 'setPrecedence',
        'deleted_at' => 'setDeletedAt',
        'note' => 'setNote',
        'label' => 'setLabel',
        'internally_created' => 'setInternallyCreated',
        'cos_object_type' => 'setCosObjectType',
        'cdn_purge_embargo_time' => 'setCdnPurgeEmbargoTime'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'portal_id' => 'getPortalId',
        'created' => 'getCreated',
        'updated' => 'getUpdated',
        'created_by_id' => 'getCreatedById',
        'updated_by_id' => 'getUpdatedById',
        'route_prefix' => 'getRoutePrefix',
        'destination' => 'getDestination',
        'redirect_style' => 'getRedirectStyle',
        'content_group_id' => 'getContentGroupId',
        'is_only_after_not_found' => 'getIsOnlyAfterNotFound',
        'is_regex' => 'getIsRegex',
        'is_match_full_url' => 'getIsMatchFullUrl',
        'is_match_query_string' => 'getIsMatchQueryString',
        'is_pattern' => 'getIsPattern',
        'is_trailing_slash_optional' => 'getIsTrailingSlashOptional',
        'is_protocol_agnostic' => 'getIsProtocolAgnostic',
        'name' => 'getName',
        'precedence' => 'getPrecedence',
        'deleted_at' => 'getDeletedAt',
        'note' => 'getNote',
        'label' => 'getLabel',
        'internally_created' => 'getInternallyCreated',
        'cos_object_type' => 'getCosObjectType',
        'cdn_purge_embargo_time' => 'getCdnPurgeEmbargoTime'
    ];

    /**
     * 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;
    }

    public const COS_OBJECT_TYPE_CONTENT = 'CONTENT';
    public const COS_OBJECT_TYPE_EXTENSION_RESOURCE = 'EXTENSION_RESOURCE';
    public const COS_OBJECT_TYPE_LAYOUT = 'LAYOUT';
    public const COS_OBJECT_TYPE_CUSTOM_WIDGET = 'CUSTOM_WIDGET';
    public const COS_OBJECT_TYPE_WIDGET = 'WIDGET';
    public const COS_OBJECT_TYPE_FORM = 'FORM';
    public const COS_OBJECT_TYPE_PLACEMENT = 'PLACEMENT';
    public const COS_OBJECT_TYPE_IMAGE = 'IMAGE';
    public const COS_OBJECT_TYPE_DOMAIN_SETTINGS = 'DOMAIN_SETTINGS';
    public const COS_OBJECT_TYPE_SITE_SETTINGS = 'SITE_SETTINGS';
    public const COS_OBJECT_TYPE_EMAIL_ADDRESS = 'EMAIL_ADDRESS';
    public const COS_OBJECT_TYPE_WORKFLOW = 'WORKFLOW';
    public const COS_OBJECT_TYPE_HUBDB_TABLE = 'HUBDB_TABLE';
    public const COS_OBJECT_TYPE_REDIRECT_URL = 'REDIRECT_URL';
    public const COS_OBJECT_TYPE_DESIGN_FOLDER = 'DESIGN_FOLDER';
    public const COS_OBJECT_TYPE_SITE_MAP = 'SITE_MAP';
    public const COS_OBJECT_TYPE_DOMAIN = 'DOMAIN';
    public const COS_OBJECT_TYPE_BLOG = 'BLOG';
    public const COS_OBJECT_TYPE_FILE = 'FILE';
    public const COS_OBJECT_TYPE_FOLDER = 'FOLDER';
    public const COS_OBJECT_TYPE_SITE_MENU = 'SITE_MENU';
    public const COS_OBJECT_TYPE_THEME = 'THEME';
    public const COS_OBJECT_TYPE_CONTENT_GROUP = 'CONTENT_GROUP';
    public const COS_OBJECT_TYPE_FOLLOW_ME = 'FOLLOW_ME';
    public const COS_OBJECT_TYPE_KNOWLEDGE_BASE = 'KNOWLEDGE_BASE';
    public const COS_OBJECT_TYPE_LIST_MEMBERSHIP = 'LIST_MEMBERSHIP';
    public const COS_OBJECT_TYPE_CONTACT_MEMBERSHIP = 'CONTACT_MEMBERSHIP';
    public const COS_OBJECT_TYPE_PASSWORD_PROTECTED = 'PASSWORD_PROTECTED';
    public const COS_OBJECT_TYPE_UNRESTRICTED_ACCESS = 'UNRESTRICTED_ACCESS';
    public const COS_OBJECT_TYPE_MARKETPLACE_LISTING = 'MARKETPLACE_LISTING';
    public const COS_OBJECT_TYPE_LAYOUT_SECTION = 'LAYOUT_SECTION';
    public const COS_OBJECT_TYPE_THEME_SETTINGS = 'THEME_SETTINGS';
    public const COS_OBJECT_TYPE_VIDEO_PLAYER = 'VIDEO_PLAYER';
    public const COS_OBJECT_TYPE_URL_MAPPING = 'URL_MAPPING';
    public const COS_OBJECT_TYPE_KNOWLEDGE_CATEGORY = 'KNOWLEDGE_CATEGORY';
    public const COS_OBJECT_TYPE_KNOWLEDGE_HOMEPAGE_CATEGORY = 'KNOWLEDGE_HOMEPAGE_CATEGORY';
    public const COS_OBJECT_TYPE_RAW_ASSET = 'RAW_ASSET';
    public const COS_OBJECT_TYPE_GLOBAL_CONTENT = 'GLOBAL_CONTENT';
    public const COS_OBJECT_TYPE_HUBDB_TABLE_ROW = 'HUBDB_TABLE_ROW';
    public const COS_OBJECT_TYPE_BLOG_AUTHOR = 'BLOG_AUTHOR';
    public const COS_OBJECT_TYPE_SERVERLESS_FUNCTION = 'SERVERLESS_FUNCTION';
    public const COS_OBJECT_TYPE_KNOWLEDGE_CATEGORY_TRANSLATION = 'KNOWLEDGE_CATEGORY_TRANSLATION';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getCosObjectTypeAllowableValues()
    {
        return [
            self::COS_OBJECT_TYPE_CONTENT,
            self::COS_OBJECT_TYPE_EXTENSION_RESOURCE,
            self::COS_OBJECT_TYPE_LAYOUT,
            self::COS_OBJECT_TYPE_CUSTOM_WIDGET,
            self::COS_OBJECT_TYPE_WIDGET,
            self::COS_OBJECT_TYPE_FORM,
            self::COS_OBJECT_TYPE_PLACEMENT,
            self::COS_OBJECT_TYPE_IMAGE,
            self::COS_OBJECT_TYPE_DOMAIN_SETTINGS,
            self::COS_OBJECT_TYPE_SITE_SETTINGS,
            self::COS_OBJECT_TYPE_EMAIL_ADDRESS,
            self::COS_OBJECT_TYPE_WORKFLOW,
            self::COS_OBJECT_TYPE_HUBDB_TABLE,
            self::COS_OBJECT_TYPE_REDIRECT_URL,
            self::COS_OBJECT_TYPE_DESIGN_FOLDER,
            self::COS_OBJECT_TYPE_SITE_MAP,
            self::COS_OBJECT_TYPE_DOMAIN,
            self::COS_OBJECT_TYPE_BLOG,
            self::COS_OBJECT_TYPE_FILE,
            self::COS_OBJECT_TYPE_FOLDER,
            self::COS_OBJECT_TYPE_SITE_MENU,
            self::COS_OBJECT_TYPE_THEME,
            self::COS_OBJECT_TYPE_CONTENT_GROUP,
            self::COS_OBJECT_TYPE_FOLLOW_ME,
            self::COS_OBJECT_TYPE_KNOWLEDGE_BASE,
            self::COS_OBJECT_TYPE_LIST_MEMBERSHIP,
            self::COS_OBJECT_TYPE_CONTACT_MEMBERSHIP,
            self::COS_OBJECT_TYPE_PASSWORD_PROTECTED,
            self::COS_OBJECT_TYPE_UNRESTRICTED_ACCESS,
            self::COS_OBJECT_TYPE_MARKETPLACE_LISTING,
            self::COS_OBJECT_TYPE_LAYOUT_SECTION,
            self::COS_OBJECT_TYPE_THEME_SETTINGS,
            self::COS_OBJECT_TYPE_VIDEO_PLAYER,
            self::COS_OBJECT_TYPE_URL_MAPPING,
            self::COS_OBJECT_TYPE_KNOWLEDGE_CATEGORY,
            self::COS_OBJECT_TYPE_KNOWLEDGE_HOMEPAGE_CATEGORY,
            self::COS_OBJECT_TYPE_RAW_ASSET,
            self::COS_OBJECT_TYPE_GLOBAL_CONTENT,
            self::COS_OBJECT_TYPE_HUBDB_TABLE_ROW,
            self::COS_OBJECT_TYPE_BLOG_AUTHOR,
            self::COS_OBJECT_TYPE_SERVERLESS_FUNCTION,
            self::COS_OBJECT_TYPE_KNOWLEDGE_CATEGORY_TRANSLATION,
        ];
    }

    /**
     * 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['id'] = $data['id'] ?? null;
        $this->container['portal_id'] = $data['portal_id'] ?? null;
        $this->container['created'] = $data['created'] ?? null;
        $this->container['updated'] = $data['updated'] ?? null;
        $this->container['created_by_id'] = $data['created_by_id'] ?? null;
        $this->container['updated_by_id'] = $data['updated_by_id'] ?? null;
        $this->container['route_prefix'] = $data['route_prefix'] ?? null;
        $this->container['destination'] = $data['destination'] ?? null;
        $this->container['redirect_style'] = $data['redirect_style'] ?? null;
        $this->container['content_group_id'] = $data['content_group_id'] ?? null;
        $this->container['is_only_after_not_found'] = $data['is_only_after_not_found'] ?? null;
        $this->container['is_regex'] = $data['is_regex'] ?? null;
        $this->container['is_match_full_url'] = $data['is_match_full_url'] ?? null;
        $this->container['is_match_query_string'] = $data['is_match_query_string'] ?? null;
        $this->container['is_pattern'] = $data['is_pattern'] ?? null;
        $this->container['is_trailing_slash_optional'] = $data['is_trailing_slash_optional'] ?? null;
        $this->container['is_protocol_agnostic'] = $data['is_protocol_agnostic'] ?? null;
        $this->container['name'] = $data['name'] ?? null;
        $this->container['precedence'] = $data['precedence'] ?? null;
        $this->container['deleted_at'] = $data['deleted_at'] ?? null;
        $this->container['note'] = $data['note'] ?? null;
        $this->container['label'] = $data['label'] ?? null;
        $this->container['internally_created'] = $data['internally_created'] ?? null;
        $this->container['cos_object_type'] = $data['cos_object_type'] ?? null;
        $this->container['cdn_purge_embargo_time'] = $data['cdn_purge_embargo_time'] ?? 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['portal_id'] === null) {
            $invalidProperties[] = "'portal_id' can't be null";
        }
        if ($this->container['created'] === null) {
            $invalidProperties[] = "'created' can't be null";
        }
        if ($this->container['updated'] === null) {
            $invalidProperties[] = "'updated' can't be null";
        }
        if ($this->container['created_by_id'] === null) {
            $invalidProperties[] = "'created_by_id' can't be null";
        }
        if ($this->container['updated_by_id'] === null) {
            $invalidProperties[] = "'updated_by_id' can't be null";
        }
        if ($this->container['route_prefix'] === null) {
            $invalidProperties[] = "'route_prefix' can't be null";
        }
        if ($this->container['destination'] === null) {
            $invalidProperties[] = "'destination' can't be null";
        }
        if ($this->container['redirect_style'] === null) {
            $invalidProperties[] = "'redirect_style' can't be null";
        }
        if ($this->container['content_group_id'] === null) {
            $invalidProperties[] = "'content_group_id' can't be null";
        }
        if ($this->container['is_only_after_not_found'] === null) {
            $invalidProperties[] = "'is_only_after_not_found' can't be null";
        }
        if ($this->container['is_regex'] === null) {
            $invalidProperties[] = "'is_regex' can't be null";
        }
        if ($this->container['is_match_full_url'] === null) {
            $invalidProperties[] = "'is_match_full_url' can't be null";
        }
        if ($this->container['is_match_query_string'] === null) {
            $invalidProperties[] = "'is_match_query_string' can't be null";
        }
        if ($this->container['is_pattern'] === null) {
            $invalidProperties[] = "'is_pattern' can't be null";
        }
        if ($this->container['is_trailing_slash_optional'] === null) {
            $invalidProperties[] = "'is_trailing_slash_optional' can't be null";
        }
        if ($this->container['is_protocol_agnostic'] === null) {
            $invalidProperties[] = "'is_protocol_agnostic' can't be null";
        }
        if ($this->container['name'] === null) {
            $invalidProperties[] = "'name' can't be null";
        }
        if ($this->container['precedence'] === null) {
            $invalidProperties[] = "'precedence' can't be null";
        }
        if ($this->container['deleted_at'] === null) {
            $invalidProperties[] = "'deleted_at' can't be null";
        }
        if ($this->container['note'] === null) {
            $invalidProperties[] = "'note' can't be null";
        }
        if ($this->container['label'] === null) {
            $invalidProperties[] = "'label' can't be null";
        }
        if ($this->container['internally_created'] === null) {
            $invalidProperties[] = "'internally_created' can't be null";
        }
        if ($this->container['cos_object_type'] === null) {
            $invalidProperties[] = "'cos_object_type' can't be null";
        }
        $allowedValues = $this->getCosObjectTypeAllowableValues();
        if (!is_null($this->container['cos_object_type']) && !in_array($this->container['cos_object_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'cos_object_type', must be one of '%s'",
                $this->container['cos_object_type'],
                implode("', '", $allowedValues)
            );
        }

        if ($this->container['cdn_purge_embargo_time'] === null) {
            $invalidProperties[] = "'cdn_purge_embargo_time' 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 id
     *
     * @return int
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int $id The unique ID of this URL redirect.
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets route_prefix
     *
     * @param string $route_prefix The target incoming URL, path, or pattern to match for redirection.
     *
     * @return self
     */
    public function setRoutePrefix($route_prefix)
    {
        $this->container['route_prefix'] = $route_prefix;

        return $this;
    }

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

    /**
     * Sets destination
     *
     * @param string $destination The destination URL, where the target URL should be redirected if it matches the `routePrefix`.
     *
     * @return self
     */
    public function setDestination($destination)
    {
        $this->container['destination'] = $destination;

        return $this;
    }

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

    /**
     * Sets redirect_style
     *
     * @param int $redirect_style The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details [here](https://knowledge.hubspot.com/cos-general/how-to-redirect-a-hubspot-page).
     *
     * @return self
     */
    public function setRedirectStyle($redirect_style)
    {
        $this->container['redirect_style'] = $redirect_style;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets is_only_after_not_found
     *
     * @return bool
     */
    public function getIsOnlyAfterNotFound()
    {
        return $this->container['is_only_after_not_found'];
    }

    /**
     * Sets is_only_after_not_found
     *
     * @param bool $is_only_after_not_found Whether the URL redirect mapping should apply only if a live page on the URL isn't found. If False, the URL redirect mapping will take precedence over any existing page.
     *
     * @return self
     */
    public function setIsOnlyAfterNotFound($is_only_after_not_found)
    {
        $this->container['is_only_after_not_found'] = $is_only_after_not_found;

        return $this;
    }

    /**
     * Gets is_regex
     *
     * @return bool
     */
    public function getIsRegex()
    {
        return $this->container['is_regex'];
    }

    /**
     * Sets is_regex
     *
     * @param bool $is_regex is_regex
     *
     * @return self
     */
    public function setIsRegex($is_regex)
    {
        $this->container['is_regex'] = $is_regex;

        return $this;
    }

    /**
     * Gets is_match_full_url
     *
     * @return bool
     */
    public function getIsMatchFullUrl()
    {
        return $this->container['is_match_full_url'];
    }

    /**
     * Sets is_match_full_url
     *
     * @param bool $is_match_full_url Whether the `routePrefix` should match on the entire URL, including the domain.
     *
     * @return self
     */
    public function setIsMatchFullUrl($is_match_full_url)
    {
        $this->container['is_match_full_url'] = $is_match_full_url;

        return $this;
    }

    /**
     * Gets is_match_query_string
     *
     * @return bool
     */
    public function getIsMatchQueryString()
    {
        return $this->container['is_match_query_string'];
    }

    /**
     * Sets is_match_query_string
     *
     * @param bool $is_match_query_string Whether the `routePrefix` should match on the entire URL path, including the query string.
     *
     * @return self
     */
    public function setIsMatchQueryString($is_match_query_string)
    {
        $this->container['is_match_query_string'] = $is_match_query_string;

        return $this;
    }

    /**
     * Gets is_pattern
     *
     * @return bool
     */
    public function getIsPattern()
    {
        return $this->container['is_pattern'];
    }

    /**
     * Sets is_pattern
     *
     * @param bool $is_pattern Whether the `routePrefix` should match based on pattern.
     *
     * @return self
     */
    public function setIsPattern($is_pattern)
    {
        $this->container['is_pattern'] = $is_pattern;

        return $this;
    }

    /**
     * Gets is_trailing_slash_optional
     *
     * @return bool
     */
    public function getIsTrailingSlashOptional()
    {
        return $this->container['is_trailing_slash_optional'];
    }

    /**
     * Sets is_trailing_slash_optional
     *
     * @param bool $is_trailing_slash_optional Whether a trailing slash will be ignored.
     *
     * @return self
     */
    public function setIsTrailingSlashOptional($is_trailing_slash_optional)
    {
        $this->container['is_trailing_slash_optional'] = $is_trailing_slash_optional;

        return $this;
    }

    /**
     * Gets is_protocol_agnostic
     *
     * @return bool
     */
    public function getIsProtocolAgnostic()
    {
        return $this->container['is_protocol_agnostic'];
    }

    /**
     * Sets is_protocol_agnostic
     *
     * @param bool $is_protocol_agnostic Whether the `routePrefix` should match both HTTP and HTTPS protocols.
     *
     * @return self
     */
    public function setIsProtocolAgnostic($is_protocol_agnostic)
    {
        $this->container['is_protocol_agnostic'] = $is_protocol_agnostic;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets precedence
     *
     * @param int $precedence Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the **lower** precedence will be used.
     *
     * @return self
     */
    public function setPrecedence($precedence)
    {
        $this->container['precedence'] = $precedence;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets internally_created
     *
     * @return bool
     */
    public function getInternallyCreated()
    {
        return $this->container['internally_created'];
    }

    /**
     * Sets internally_created
     *
     * @param bool $internally_created internally_created
     *
     * @return self
     */
    public function setInternallyCreated($internally_created)
    {
        $this->container['internally_created'] = $internally_created;

        return $this;
    }

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

    /**
     * Sets cos_object_type
     *
     * @param string $cos_object_type cos_object_type
     *
     * @return self
     */
    public function setCosObjectType($cos_object_type)
    {
        $allowedValues = $this->getCosObjectTypeAllowableValues();
        if (!in_array($cos_object_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'cos_object_type', must be one of '%s'",
                    $cos_object_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['cos_object_type'] = $cos_object_type;

        return $this;
    }

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

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

        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));
    }
}


