(20250825) -Added new google places API Integration system, no more oauth system for places api integration,
added multiple files for and correction and changes as well.
This commit is contained in:
@@ -43,6 +43,7 @@ from typing import Optional, Literal, Union
|
||||
from models.software.tcaoff_ai.auth import TheCAOfficeAIAuth
|
||||
from models.software.mikrotik.auth import MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth
|
||||
from models.software.ecommerce.auth import ShopifyAuth
|
||||
from models.software.places.oauth import GooglePlacesAuth
|
||||
# My utils:
|
||||
from utils_v2.string import regex
|
||||
from utils_v2.date_time import date_time
|
||||
@@ -105,8 +106,8 @@ class SoftwareAuthRequestHeaders(BaseModel):
|
||||
|
||||
class SoftwareAuthRequestData(BaseModel):
|
||||
|
||||
softwareClient: Literal["theCaOfficeAi", "mikrotikPPPoE1000", "mikrotikHotspot1000", "shopify"] = Field(alias = "client")
|
||||
auth: Union[TheCAOfficeAIAuth, MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth, ShopifyAuth]
|
||||
softwareClient: Literal["theCaOfficeAi", "mikrotikPPPoE1000", "mikrotikHotspot1000", "shopify", "googlePlaces"] = Field(alias = "client")
|
||||
auth: Union[TheCAOfficeAIAuth, MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth, ShopifyAuth, GooglePlacesAuth]
|
||||
|
||||
# ┏┓ ┏•
|
||||
# ┃ ┏┓┏┓╋┓┏┓
|
||||
@@ -128,7 +129,8 @@ class SoftwareAuthRequestData(BaseModel):
|
||||
"theCaOfficeAi": TheCAOfficeAIAuth,
|
||||
"mikrotikPPPoE1000": MikroTikPPPoE1000Auth,
|
||||
"mikrotikHotspot1000": MikroTikHotspot1000Auth,
|
||||
"shopify": ShopifyAuth
|
||||
"shopify": ShopifyAuth,
|
||||
"googlePlaces": GooglePlacesAuth
|
||||
}
|
||||
if not isinstance(auth, harmony_map[client]):
|
||||
raise ValueError(f"incorrect 'auth' for selected client '{client}'")
|
||||
|
||||
@@ -38,7 +38,7 @@ sys.path.append("..")
|
||||
|
||||
# For making data behaviour_models:
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import Optional, Literal
|
||||
from typing import Optional, Literal, Any
|
||||
|
||||
# My utils:
|
||||
from utils_v2.string import regex
|
||||
@@ -123,6 +123,56 @@ class OAuthPlacesAuthorizationRequestData(BaseModel):
|
||||
pass
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
class PlacesAuthResponse(BaseModel):
|
||||
|
||||
success: bool = Field(
|
||||
description = "To indicate whether or not, the action was a success",
|
||||
frozen = False,
|
||||
default = False
|
||||
)
|
||||
|
||||
token_id : str = Field(
|
||||
description="MongoDb object id",
|
||||
frozen=False,
|
||||
default=False
|
||||
)
|
||||
|
||||
message: str = Field(
|
||||
description = "To explain what happened in the process of handling the OAuth callback.",
|
||||
frozen = False,
|
||||
default = "ERR: Message not captured."
|
||||
)
|
||||
|
||||
exception: Any = Field(
|
||||
description = "To pass on any exception that occurred in the process.",
|
||||
frozen = False,
|
||||
default = None
|
||||
)
|
||||
|
||||
# ┏┓ ┏•
|
||||
# ┃ ┏┓┏┓╋┓┏┓
|
||||
# ┗┛┗┛┛┗┛┗┗┫
|
||||
# ┛
|
||||
|
||||
class Config:
|
||||
extra = "forbid"
|
||||
|
||||
# ┏┓ ┏┓
|
||||
# ┃ ┓┏┏╋┏┓┏┳┓ ┣ ┓┏┏┓┏┏
|
||||
# ┗┛┗┻┛┗┗┛┛┗┗ ┻ ┗┻┛┗┗┛
|
||||
|
||||
pass
|
||||
|
||||
# ┓┏ ┓• ┓ •
|
||||
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
|
||||
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
|
||||
|
||||
pass
|
||||
|
||||
# *****************************************************************************************************************
|
||||
# ***** ****
|
||||
# *** MAIN PROGRAM ***
|
||||
|
||||
@@ -345,15 +345,15 @@ class PlacesTextSearchRequestData(BaseModel):
|
||||
frozen = True
|
||||
)
|
||||
|
||||
textQuery: float = Field(
|
||||
textQuery: str = Field(
|
||||
description= "Text Query for find places",
|
||||
frozen= True
|
||||
)
|
||||
|
||||
max_count: int = Field(
|
||||
maxCount: int = Field(
|
||||
description= "Max count for get result counts",
|
||||
frozen=True,
|
||||
default=20
|
||||
default=5
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user