# coding: utf-8

"""
    Conekta API

    Conekta sdk  # noqa: E501

    The version of the OpenAPI document: 2.1.0
    Contact: engineering@conekta.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


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


from typing import Any, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist

class LogsResponseData(BaseModel):
    """
    LogsResponseData
    """
    created_at: Optional[StrictInt] = None
    id: Optional[StrictStr] = None
    ip_address: Optional[StrictStr] = None
    livemode: Optional[StrictBool] = None
    loggable_id: Optional[StrictStr] = None
    loggable_type: Optional[StrictStr] = None
    method: Optional[StrictStr] = None
    oauth_token_id: Optional[StrictStr] = None
    query_string: Optional[Dict[str, Any]] = None
    related: Optional[StrictStr] = None
    request_body: Optional[Dict[str, Any]] = None
    request_headers: Optional[Dict[str, StrictStr]] = None
    response_body: Optional[Dict[str, Any]] = None
    response_headers: Optional[Dict[str, StrictStr]] = None
    searchable_tags: Optional[conlist(StrictStr)] = None
    status: Optional[StrictStr] = None
    updated_at: Optional[StrictStr] = None
    url: Optional[StrictStr] = None
    user_account_id: Optional[StrictStr] = None
    version: Optional[StrictStr] = None
    __properties = ["created_at", "id", "ip_address", "livemode", "loggable_id", "loggable_type", "method", "oauth_token_id", "query_string", "related", "request_body", "request_headers", "response_body", "response_headers", "searchable_tags", "status", "updated_at", "url", "user_account_id", "version"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

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

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # set to None if loggable_id (nullable) is None
        # and __fields_set__ contains the field
        if self.loggable_id is None and "loggable_id" in self.__fields_set__:
            _dict['loggable_id'] = None

        # set to None if loggable_type (nullable) is None
        # and __fields_set__ contains the field
        if self.loggable_type is None and "loggable_type" in self.__fields_set__:
            _dict['loggable_type'] = None

        # set to None if oauth_token_id (nullable) is None
        # and __fields_set__ contains the field
        if self.oauth_token_id is None and "oauth_token_id" in self.__fields_set__:
            _dict['oauth_token_id'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> LogsResponseData:
        """Create an instance of LogsResponseData from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return LogsResponseData.parse_obj(obj)

        _obj = LogsResponseData.parse_obj({
            "created_at": obj.get("created_at"),
            "id": obj.get("id"),
            "ip_address": obj.get("ip_address"),
            "livemode": obj.get("livemode"),
            "loggable_id": obj.get("loggable_id"),
            "loggable_type": obj.get("loggable_type"),
            "method": obj.get("method"),
            "oauth_token_id": obj.get("oauth_token_id"),
            "query_string": obj.get("query_string"),
            "related": obj.get("related"),
            "request_body": obj.get("request_body"),
            "request_headers": obj.get("request_headers"),
            "response_body": obj.get("response_body"),
            "response_headers": obj.get("response_headers"),
            "searchable_tags": obj.get("searchable_tags"),
            "status": obj.get("status"),
            "updated_at": obj.get("updated_at"),
            "url": obj.get("url"),
            "user_account_id": obj.get("user_account_id"),
            "version": obj.get("version")
        })
        return _obj

