# coding: utf-8

"""
    Pinterest REST API

    Pinterest's REST API

    The version of the OpenAPI document: 5.23.0
    Contact: blah+oapicf@cliffano.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class CatalogsFeedIngestionErrors(BaseModel):
    """
    CatalogsFeedIngestionErrors
    """ # noqa: E501
    account_flagged: Optional[StrictInt] = Field(default=None, description="We detected an issue with your account and are not currently ingesting your items. Please review our policies at policy.pinterest.com/community-guidelines#section-spam or contact us at help.pinterest.com/contact for more information.", alias="ACCOUNT_FLAGGED")
    fetch_google_sheet_not_shared: Optional[StrictInt] = Field(default=None, description="Update your Google Sheets sharing settings to 'Anyone with link' as a Viewer so that Pinterest can access your file.", alias="FETCH_GOOGLE_SHEET_NOT_SHARED")
    image_file_not_accessible: Optional[StrictInt] = Field(default=None, description="Image files are unreadable. Please upload new files to continue.", alias="IMAGE_FILE_NOT_ACCESSIBLE")
    image_file_not_found: Optional[StrictInt] = Field(default=None, description="Image files are unreadable. Please upload new files to continue.", alias="IMAGE_FILE_NOT_FOUND")
    image_invalid_file: Optional[StrictInt] = Field(default=None, description="Image files are unreadable. Please upload new files to continue.", alias="IMAGE_INVALID_FILE")
    image_level_internal_error: Optional[StrictInt] = Field(default=None, description="We experienced a technical difficulty and were unable to download some images. The next download attempt will happen in 24 hours.", alias="IMAGE_LEVEL_INTERNAL_ERROR")
    image_malformed_url: Optional[StrictInt] = Field(default=None, description="Image files are unreadable. Please check your link and upload new files to continue.", alias="IMAGE_MALFORMED_URL")
    large_product_count_decrease: Optional[StrictInt] = Field(default=None, description="The product count has decreased by more than 99% compared to the last successful ingestion.", alias="LARGE_PRODUCT_COUNT_DECREASE")
    line_level_internal_error: Optional[StrictInt] = Field(default=None, description="We experienced a technical difficulty and were unable to ingest this some items. The next ingestion will happen in 24 hours.", alias="LINE_LEVEL_INTERNAL_ERROR")
    __properties: ClassVar[List[str]] = ["ACCOUNT_FLAGGED", "FETCH_GOOGLE_SHEET_NOT_SHARED", "IMAGE_FILE_NOT_ACCESSIBLE", "IMAGE_FILE_NOT_FOUND", "IMAGE_INVALID_FILE", "IMAGE_LEVEL_INTERNAL_ERROR", "IMAGE_MALFORMED_URL", "LARGE_PRODUCT_COUNT_DECREASE", "LINE_LEVEL_INTERNAL_ERROR"]

    @field_validator('large_product_count_decrease')
    def large_product_count_decrease_validate_enum(cls, value):
        """Validates the enum"""
        if value is None:
            return value

        if value not in set([1]):
            raise ValueError("must be one of enum values (1)")
        return value

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of CatalogsFeedIngestionErrors from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of CatalogsFeedIngestionErrors from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "ACCOUNT_FLAGGED": obj.get("ACCOUNT_FLAGGED"),
            "FETCH_GOOGLE_SHEET_NOT_SHARED": obj.get("FETCH_GOOGLE_SHEET_NOT_SHARED"),
            "IMAGE_FILE_NOT_ACCESSIBLE": obj.get("IMAGE_FILE_NOT_ACCESSIBLE"),
            "IMAGE_FILE_NOT_FOUND": obj.get("IMAGE_FILE_NOT_FOUND"),
            "IMAGE_INVALID_FILE": obj.get("IMAGE_INVALID_FILE"),
            "IMAGE_LEVEL_INTERNAL_ERROR": obj.get("IMAGE_LEVEL_INTERNAL_ERROR"),
            "IMAGE_MALFORMED_URL": obj.get("IMAGE_MALFORMED_URL"),
            "LARGE_PRODUCT_COUNT_DECREASE": obj.get("LARGE_PRODUCT_COUNT_DECREASE"),
            "LINE_LEVEL_INTERNAL_ERROR": obj.get("LINE_LEVEL_INTERNAL_ERROR")
        })
        return _obj


