models.py•22.5 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-07-16T00:44:01+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional
from uuid import UUID
from pydantic import BaseModel, Field
class Status(Enum):
PENDING = 'PENDING'
PROCESSING = 'PROCESSING'
CANCELED = 'CANCELED'
COMPLETE = 'COMPLETE'
class HttpStatus(Enum):
CONTINUE = 'CONTINUE'
SWITCHING_PROTOCOLS = 'SWITCHING_PROTOCOLS'
PROCESSING = 'PROCESSING'
OK = 'OK'
CREATED = 'CREATED'
ACCEPTED = 'ACCEPTED'
NON_AUTHORITATIVE_INFORMATION = 'NON_AUTHORITATIVE_INFORMATION'
NO_CONTENT = 'NO_CONTENT'
RESET_CONTENT = 'RESET_CONTENT'
PARTIAL_CONTENT = 'PARTIAL_CONTENT'
MULTI_STATUS = 'MULTI_STATUS'
ALREADY_REPORTED = 'ALREADY_REPORTED'
IM_USED = 'IM_USED'
MULTIPLE_CHOICES = 'MULTIPLE_CHOICES'
MOVED_PERMANENTLY = 'MOVED_PERMANENTLY'
FOUND = 'FOUND'
SEE_OTHER = 'SEE_OTHER'
NOT_MODIFIED = 'NOT_MODIFIED'
USE_PROXY = 'USE_PROXY'
TEMPORARY_REDIRECT = 'TEMPORARY_REDIRECT'
PERMANENT_REDIRECT = 'PERMANENT_REDIRECT'
BAD_REQUEST = 'BAD_REQUEST'
UNAUTHORIZED = 'UNAUTHORIZED'
PAYMENT_REQUIRED = 'PAYMENT_REQUIRED'
FORBIDDEN = 'FORBIDDEN'
NOT_FOUND = 'NOT_FOUND'
METHOD_NOT_ALLOWED = 'METHOD_NOT_ALLOWED'
NOT_ACCEPTABLE = 'NOT_ACCEPTABLE'
PROXY_AUTHENTICATION_REQUIRED = 'PROXY_AUTHENTICATION_REQUIRED'
REQUEST_TIMEOUT = 'REQUEST_TIMEOUT'
CONFLICT = 'CONFLICT'
GONE = 'GONE'
LENGTH_REQUIRED = 'LENGTH_REQUIRED'
PRECONDITION_FAILED = 'PRECONDITION_FAILED'
REQUEST_ENTITY_TOO_LARGE = 'REQUEST_ENTITY_TOO_LARGE'
REQUEST_URI_TOO_LONG = 'REQUEST_URI_TOO_LONG'
UNSUPPORTED_MEDIA_TYPE = 'UNSUPPORTED_MEDIA_TYPE'
REQUESTED_RANGE_NOT_SATISFIABLE = 'REQUESTED_RANGE_NOT_SATISFIABLE'
EXPECTATION_FAILED = 'EXPECTATION_FAILED'
IM_A_TEAPOT = 'IM_A_TEAPOT'
MISDIRECTED_REQUEST = 'MISDIRECTED_REQUEST'
UNPROCESSABLE_ENTITY = 'UNPROCESSABLE_ENTITY'
LOCKED = 'LOCKED'
FAILED_DEPENDENCY = 'FAILED_DEPENDENCY'
UPGRADE_REQUIRED = 'UPGRADE_REQUIRED'
PRECONDITION_REQUIRED = 'PRECONDITION_REQUIRED'
TOO_MANY_REQUESTS = 'TOO_MANY_REQUESTS'
REQUEST_HEADERS_FIELDS_TOO_LARGE = 'REQUEST_HEADERS_FIELDS_TOO_LARGE'
INTERNAL_STALE_SERVICE_DISCOVERY = 'INTERNAL_STALE_SERVICE_DISCOVERY'
UNAVAILABLE_FOR_LEGAL_REASONS = 'UNAVAILABLE_FOR_LEGAL_REASONS'
MIGRATION_IN_PROGRESS = 'MIGRATION_IN_PROGRESS'
INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR'
NOT_IMPLEMENTED = 'NOT_IMPLEMENTED'
BAD_GATEWAY = 'BAD_GATEWAY'
SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE'
GATEWAY_TIMEOUT = 'GATEWAY_TIMEOUT'
HTTP_VERSION_NOT_SUPPORTED = 'HTTP_VERSION_NOT_SUPPORTED'
VARIANT_ALSO_NEGOTIATES = 'VARIANT_ALSO_NEGOTIATES'
INSUFFICIENT_STORAGE = 'INSUFFICIENT_STORAGE'
LOOP_DETECTED = 'LOOP_DETECTED'
NOT_EXTENDED = 'NOT_EXTENDED'
NETWORK_AUTHENTICATION_REQUIRED = 'NETWORK_AUTHENTICATION_REQUIRED'
class ErrorCategory(BaseModel):
httpStatus: HttpStatus
name: str
class ErrorDetail(BaseModel):
code: Optional[str] = Field(
None, description='The status code associated with the error detail'
)
context: Optional[Dict[str, List[str]]] = Field(
None,
description='Context about the error condition',
examples=[{'missingScopes': ['scope1', 'scope2']}],
)
in_: Optional[str] = Field(
None,
alias='in',
description='The name of the field or parameter in which the error was found.',
)
message: str = Field(
...,
description='A human readable message describing the error along with remediation steps where appropriate',
)
subCategory: Optional[str] = Field(
None,
description='A specific category that contains more specific detail about the error',
)
class EventDetailSettings(BaseModel):
appId: int = Field(
..., description='The id of the application the settings are for'
)
eventDetailsUrl: str = Field(
...,
description='The url that will be used to fetch marketing event details by id',
)
class EventDetailSettingsUrl(BaseModel):
eventDetailsUrl: str = Field(
...,
description='The url that will be used to fetch marketing event details by id. Must contain a `%s` character sequence that will be substituted with the event id. For example: `https://my.event.app/events/%s`',
)
class MarketingEventCompleteRequestParams(BaseModel):
endDateTime: datetime
startDateTime: datetime
class MarketingEventEmailSubscriber(BaseModel):
contactProperties: Optional[Dict[str, str]] = None
email: str = Field(
...,
description='The email address of the contact in HubSpot to associate with the event. Note that the contact must already exist in HubSpot; a contact will not be created.',
)
interactionDateTime: int = Field(
...,
description='The date and time at which the contact subscribed to the event.',
)
properties: Optional[Dict[str, str]] = None
class MarketingEventExternalUniqueIdentifier(BaseModel):
appId: int = Field(
...,
description='The id of the application that created the marketing event in HubSpot.',
)
externalAccountId: str = Field(
...,
description='The accountId that is associated with this marketing event in the external event application.',
)
externalEventId: str = Field(
...,
description='The id of the marketing event in the external event application.',
)
class MarketingEventSubscriber(BaseModel):
interactionDateTime: int = Field(
...,
description='The date and time at which the contact subscribed to the event.',
)
properties: Optional[Dict[str, str]] = None
vid: Optional[int] = None
class Source(Enum):
IMPORT = 'IMPORT'
API = 'API'
FORM = 'FORM'
ANALYTICS = 'ANALYTICS'
MIGRATION = 'MIGRATION'
SALESFORCE = 'SALESFORCE'
INTEGRATION = 'INTEGRATION'
CONTACTS_WEB = 'CONTACTS_WEB'
WAL_INCREMENTAL = 'WAL_INCREMENTAL'
TASK = 'TASK'
EMAIL = 'EMAIL'
WORKFLOWS = 'WORKFLOWS'
CALCULATED = 'CALCULATED'
SOCIAL = 'SOCIAL'
BATCH_UPDATE = 'BATCH_UPDATE'
SIGNALS = 'SIGNALS'
BIDEN = 'BIDEN'
DEFAULT = 'DEFAULT'
COMPANIES = 'COMPANIES'
DEALS = 'DEALS'
ASSISTS = 'ASSISTS'
PRESENTATIONS = 'PRESENTATIONS'
TALLY = 'TALLY'
SIDEKICK = 'SIDEKICK'
CRM_UI = 'CRM_UI'
MERGE_CONTACTS = 'MERGE_CONTACTS'
PORTAL_USER_ASSOCIATOR = 'PORTAL_USER_ASSOCIATOR'
INTEGRATIONS_PLATFORM = 'INTEGRATIONS_PLATFORM'
BCC_TO_CRM = 'BCC_TO_CRM'
FORWARD_TO_CRM = 'FORWARD_TO_CRM'
ENGAGEMENTS = 'ENGAGEMENTS'
SALES = 'SALES'
HEISENBERG = 'HEISENBERG'
LEADIN = 'LEADIN'
GMAIL_INTEGRATION = 'GMAIL_INTEGRATION'
ACADEMY = 'ACADEMY'
SALES_MESSAGES = 'SALES_MESSAGES'
AVATARS_SERVICE = 'AVATARS_SERVICE'
MERGE_COMPANIES = 'MERGE_COMPANIES'
SEQUENCES = 'SEQUENCES'
COMPANY_FAMILIES = 'COMPANY_FAMILIES'
MOBILE_IOS = 'MOBILE_IOS'
MOBILE_ANDROID = 'MOBILE_ANDROID'
CONTACTS = 'CONTACTS'
ASSOCIATIONS = 'ASSOCIATIONS'
EXTENSION = 'EXTENSION'
SUCCESS = 'SUCCESS'
BOT = 'BOT'
INTEGRATIONS_SYNC = 'INTEGRATIONS_SYNC'
AUTOMATION_PLATFORM = 'AUTOMATION_PLATFORM'
CONVERSATIONS = 'CONVERSATIONS'
EMAIL_INTEGRATION = 'EMAIL_INTEGRATION'
CONTENT_MEMBERSHIP = 'CONTENT_MEMBERSHIP'
QUOTES = 'QUOTES'
BET_ASSIGNMENT = 'BET_ASSIGNMENT'
QUOTAS = 'QUOTAS'
BET_CRM_CONNECTOR = 'BET_CRM_CONNECTOR'
MEETINGS = 'MEETINGS'
MERGE_OBJECTS = 'MERGE_OBJECTS'
RECYCLING_BIN = 'RECYCLING_BIN'
ADS = 'ADS'
AI_GROUP = 'AI_GROUP'
COMMUNICATOR = 'COMMUNICATOR'
SETTINGS = 'SETTINGS'
PROPERTY_SETTINGS = 'PROPERTY_SETTINGS'
PIPELINE_SETTINGS = 'PIPELINE_SETTINGS'
COMPANY_INSIGHTS = 'COMPANY_INSIGHTS'
BEHAVIORAL_EVENTS = 'BEHAVIORAL_EVENTS'
PAYMENTS = 'PAYMENTS'
GOALS = 'GOALS'
PORTAL_OBJECT_SYNC = 'PORTAL_OBJECT_SYNC'
APPROVALS = 'APPROVALS'
FILE_MANAGER = 'FILE_MANAGER'
MARKETPLACE = 'MARKETPLACE'
INTERNAL_PROCESSING = 'INTERNAL_PROCESSING'
FORECASTING = 'FORECASTING'
SLACK_INTEGRATION = 'SLACK_INTEGRATION'
CRM_UI_BULK_ACTION = 'CRM_UI_BULK_ACTION'
WORKFLOW_CONTACT_DELETE_ACTION = 'WORKFLOW_CONTACT_DELETE_ACTION'
class PropertyValue(BaseModel):
name: str
persistenceTimestamp: Optional[int] = None
requestId: str
selectedByUser: bool
selectedByUserTimestamp: int
source: Source
sourceId: str
sourceLabel: str
sourceMetadata: str = Field(
...,
description='Source metadata encoded as a base64 string. For example: `ZXhhbXBsZSBzdHJpbmc=`',
)
sourceVid: List[int]
timestamp: int
updatedByUserId: Optional[int] = None
useTimestampAsPersistenceTimestamp: Optional[bool] = None
value: str
class StandardError(BaseModel):
category: ErrorCategory
context: Dict[str, List[str]]
errors: List[ErrorDetail]
id: Optional[str] = None
links: Dict[str, str]
message: str
status: str
subCategory: Optional[Dict[str, Any]] = None
class SubscriberEmailResponse(BaseModel):
email: str
vid: int
class SubscriberVidResponse(BaseModel):
vid: int
class BatchInputMarketingEventEmailSubscriber(BaseModel):
inputs: List[MarketingEventEmailSubscriber] = Field(
..., description='List of marketing event details to create or update'
)
class BatchInputMarketingEventExternalUniqueIdentifier(BaseModel):
inputs: List[MarketingEventExternalUniqueIdentifier]
class BatchInputMarketingEventSubscriber(BaseModel):
inputs: List[MarketingEventSubscriber] = Field(
..., description='List of HubSpot contacts to subscribe to the marketing event'
)
class BatchResponseSubscriberEmailResponse(BaseModel):
completedAt: datetime
errors: Optional[List[StandardError]] = None
links: Optional[Dict[str, str]] = None
numErrors: Optional[int] = None
requestedAt: Optional[datetime] = None
results: List[SubscriberEmailResponse]
startedAt: datetime
status: Status
class BatchResponseSubscriberVidResponse(BaseModel):
completedAt: datetime
errors: Optional[List[StandardError]] = None
links: Optional[Dict[str, str]] = None
numErrors: Optional[int] = None
requestedAt: Optional[datetime] = None
results: List[SubscriberVidResponse]
startedAt: datetime
status: Status
class CollectionResponseMarketingEventExternalUniqueIdentifierNoPaging(BaseModel):
results: List[MarketingEventExternalUniqueIdentifier]
class Error(BaseModel):
category: str = Field(..., description='The error category')
context: Optional[Dict[str, List[str]]] = Field(
None,
description='Context about the error condition',
examples=[
{
'invalidPropertyName': ['propertyValue'],
'missingScopes': ['scope1', 'scope2'],
}
],
)
correlationId: UUID = Field(
...,
description='A unique identifier for the request. Include this value with any error reports or support tickets',
examples=['aeb5f871-7f07-4993-9211-075dc63e7cbf'],
)
errors: Optional[List[ErrorDetail]] = Field(
None, description='further information about the error'
)
links: Optional[Dict[str, str]] = Field(
None,
description='A map of link names to associated URIs containing documentation about the error or recommended remediation steps',
)
message: str = Field(
...,
description='A human readable message describing the error along with remediation steps where appropriate',
examples=['An error occurred'],
)
subCategory: Optional[str] = Field(
None,
description='A specific category that contains more specific detail about the error',
)
class MarketingEventCreateRequestParams(BaseModel):
customProperties: Optional[List[PropertyValue]] = Field(
None,
description="A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set.\nIn order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.\n",
)
endDateTime: Optional[datetime] = Field(
None, description='The end date and time of the marketing event.'
)
eventCancelled: Optional[bool] = Field(
None,
description='Indicates if the marketing event has been cancelled. Defaults to `false`',
)
eventDescription: Optional[str] = Field(
None, description='The description of the marketing event.'
)
eventName: str = Field(..., description='The name of the marketing event.')
eventOrganizer: str = Field(
..., description='The name of the organizer of the marketing event.'
)
eventType: Optional[str] = Field(
None,
description='Describes what type of event this is. For example: `WEBINAR`, `CONFERENCE`, `WORKSHOP`',
)
eventUrl: Optional[str] = Field(
None,
description='A URL in the external event application where the marketing event can be managed.',
)
externalAccountId: str = Field(
...,
description='The accountId that is associated with this marketing event in the external event application.',
)
externalEventId: str = Field(
...,
description='The id of the marketing event in the external event application.',
)
startDateTime: Optional[datetime] = Field(
None, description='The start date and time of the marketing event.'
)
class MarketingEventDefaultResponse(BaseModel):
customProperties: Optional[List[PropertyValue]] = Field(
None,
description="A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set.\nIn order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.\n",
)
endDateTime: Optional[datetime] = Field(
None, description='The end date and time of the marketing event.'
)
eventCancelled: Optional[bool] = Field(
None, description='Indicates if the marketing event has been cancelled.'
)
eventDescription: Optional[str] = Field(
None, description='The description of the marketing event.'
)
eventName: str = Field(..., description='The name of the marketing event.')
eventOrganizer: str = Field(
..., description='The name of the organizer of the marketing event.'
)
eventType: Optional[str] = Field(
None, description='The type of the marketing event.'
)
eventUrl: Optional[str] = Field(
None,
description='The URL in the external event application where the marketing event can be managed.',
)
startDateTime: Optional[datetime] = Field(
None, description='The start date and time of the marketing event.'
)
class MarketingEventPublicDefaultResponse(BaseModel):
createdAt: datetime
customProperties: Optional[List[PropertyValue]] = Field(
None,
description="A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set.\nIn order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.\n",
)
endDateTime: Optional[datetime] = Field(
None, description='The end date and time of the marketing event.'
)
eventCancelled: Optional[bool] = Field(
None, description='Indicates if the marketing event has been cancelled.'
)
eventDescription: Optional[str] = Field(
None, description='The description of the marketing event.'
)
eventName: str = Field(..., description='The name of the marketing event.')
eventOrganizer: str = Field(
..., description='The name of the organizer of the marketing event.'
)
eventType: Optional[str] = Field(
None, description='The type of the marketing event.'
)
eventUrl: Optional[str] = Field(
None,
description='A URL in the external event application where the marketing event can be managed.',
)
id: str
startDateTime: Optional[datetime] = Field(
None, description='The start date and time of the marketing event.'
)
updatedAt: datetime
class MarketingEventPublicReadResponse(BaseModel):
attendees: int = Field(
...,
description='The number of HubSpot contacts that attended this marketing event.',
)
cancellations: int = Field(
...,
description='The number of HubSpot contacts that registered for this marketing event, but later cancelled their registration.',
)
createdAt: datetime
customProperties: Optional[List[PropertyValue]] = Field(
None,
description="A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set.\nIn order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.\n",
)
endDateTime: Optional[datetime] = Field(
None, description='The end date and time of the marketing event.'
)
eventCancelled: Optional[bool] = Field(
None, description='Indicates if the marketing event has been cancelled.'
)
eventDescription: Optional[str] = Field(
None, description='The description of the marketing event.'
)
eventName: str = Field(..., description='The name of the marketing event.')
eventOrganizer: str = Field(
..., description='The name of the organizer of the marketing event.'
)
eventType: Optional[str] = Field(
None, description='The type of the marketing event.'
)
eventUrl: Optional[str] = Field(
None,
description='A URL in the external event application where the marketing event can be managed.',
)
externalEventId: str = Field(
...,
description='The id of the marketing event in the external event application.',
)
id: str
noShows: int = Field(
...,
description='The number of HubSpot contacts that registered for this marketing event, but did not attend. This field only had a value when the event is over.',
)
registrants: int = Field(
...,
description='The number of HubSpot contacts that registered for this marketing event.',
)
startDateTime: Optional[datetime] = Field(
None, description='The start date and time of the marketing event.'
)
updatedAt: datetime
class MarketingEventUpdateRequestParams(BaseModel):
customProperties: Optional[List[PropertyValue]] = Field(
None,
description="A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set.\nIn order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.\n",
)
endDateTime: Optional[datetime] = Field(
None, description='The end date and time of the marketing event.'
)
eventCancelled: Optional[bool] = Field(
None,
description='Indicates if the marketing event has been cancelled. Defaults to `false`',
)
eventDescription: Optional[str] = Field(
None, description='The description of the marketing event.'
)
eventName: Optional[str] = Field(
None, description='The name of the marketing event.'
)
eventOrganizer: Optional[str] = Field(
None, description='The name of the organizer of the marketing event.'
)
eventType: Optional[str] = Field(
None,
description='Describes what type of event this is. For example: `WEBINAR`, `CONFERENCE`, `WORKSHOP`',
)
eventUrl: Optional[str] = Field(
None,
description='A URL in the external event application where the marketing event can be managed.',
)
startDateTime: Optional[datetime] = Field(
None, description='The start date and time of the marketing event.'
)
class BatchInputMarketingEventCreateRequestParams(BaseModel):
inputs: List[MarketingEventCreateRequestParams]
class BatchResponseMarketingEventPublicDefaultResponse(BaseModel):
completedAt: datetime
errors: Optional[List[StandardError]] = None
links: Optional[Dict[str, str]] = None
numErrors: Optional[int] = None
requestedAt: Optional[datetime] = None
results: List[MarketingEventPublicDefaultResponse]
startedAt: datetime
status: Status