# coding: utf-8

"""
    RankVectors API

    Intelligent internal linking optimization API using AI.   RankVectors helps you automatically discover and implement optimal internal links  across your website to improve SEO performance and user experience.  ## Key Features - **AI-Powered Analysis**: Uses OpenAI embeddings to find optimal linking opportunities - **Smart Crawling**: Automatically crawls and analyzes your website content - **Automated Implementation**: Implement links via webhooks or manual instructions - **Page-Based Plans**: Predictable pricing by number of pages monitored - **Multi-Platform Support**: Works with any CMS or platform via REST API  ## Getting Started 1. Create a project with your website URL 2. Start a crawl to analyze your content 3. Generate AI-powered link suggestions 4. Implement suggestions via API or webhook 5. Track performance and manage page usage and limits  ## Authentication Most API endpoints support authentication using your RankVectors API key. Include your API key in the `Authorization` header: ``` Authorization: Bearer YOUR_API_KEY ```  Get your API key from your RankVectors dashboard: Settings → API Keys  **Note**: Some endpoints (marked in the documentation) support both API key authentication and web session authentication (Stack Auth).  API key authentication is required for SDK usage and external integrations like WordPress plugins. 

    The version of the OpenAPI document: 1.3.1
    Contact: tj@rankvectors.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, StrictFloat, StrictInt
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

class ProjectAnalyticsSuggestionStats(BaseModel):
    """
    ProjectAnalyticsSuggestionStats
    """ # noqa: E501
    total: Optional[StrictInt] = None
    pending: Optional[StrictInt] = None
    approved: Optional[StrictInt] = None
    rejected: Optional[StrictInt] = None
    implemented: Optional[StrictInt] = None
    acceptance_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="acceptanceRate")
    implementation_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="implementationRate")
    avg_relevance_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="avgRelevanceScore")
    relevance_score_distribution: Optional[Dict[str, Any]] = Field(default=None, alias="relevanceScoreDistribution")
    __properties: ClassVar[List[str]] = ["total", "pending", "approved", "rejected", "implemented", "acceptanceRate", "implementationRate", "avgRelevanceScore", "relevanceScoreDistribution"]

    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 ProjectAnalyticsSuggestionStats 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 ProjectAnalyticsSuggestionStats from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "total": obj.get("total"),
            "pending": obj.get("pending"),
            "approved": obj.get("approved"),
            "rejected": obj.get("rejected"),
            "implemented": obj.get("implemented"),
            "acceptanceRate": obj.get("acceptanceRate"),
            "implementationRate": obj.get("implementationRate"),
            "avgRelevanceScore": obj.get("avgRelevanceScore"),
            "relevanceScoreDistribution": obj.get("relevanceScoreDistribution")
        })
        return _obj


