models.py•9.22 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T02:22:43+00:00
from __future__ import annotations
from enum import Enum
from typing import List, Optional
from pydantic import BaseModel, Field
class GoogleAdsHomeservicesLocalservicesV1AggregatorInfo(BaseModel):
aggregatorProviderId: Optional[str] = Field(
None,
description='Provider id (listed in aggregator system) which maps to a account id in GLS system.',
)
class GoogleAdsHomeservicesLocalservicesV1BookingLead(BaseModel):
bookingAppointmentTimestamp: Optional[str] = Field(
None, description='Timestamp of when service is provided by advertiser.'
)
consumerEmail: Optional[str] = Field(
None, description='Consumer email associated with the booking lead.'
)
consumerPhoneNumber: Optional[str] = Field(
None, description='Consumer phone number associated with the booking lead.'
)
customerName: Optional[str] = Field(
None, description='Name of the customer who created the lead.'
)
jobType: Optional[str] = Field(
None, description='The job type of the specified lead.'
)
class ChargeStatus(Enum):
CHARGE_STATUS_UNSPECIFIED = 'CHARGE_STATUS_UNSPECIFIED'
CHARGED = 'CHARGED'
NOT_CHARGED = 'NOT_CHARGED'
class LeadType(Enum):
LEAD_TYPE_UNSPECIFIED = 'LEAD_TYPE_UNSPECIFIED'
MESSAGE = 'MESSAGE'
PHONE_CALL = 'PHONE_CALL'
BOOKING = 'BOOKING'
class GoogleAdsHomeservicesLocalservicesV1MessageLead(BaseModel):
consumerPhoneNumber: Optional[str] = Field(
None, description='Consumer phone number associated with the message lead.'
)
customerName: Optional[str] = Field(
None, description='Name of the customer who created the lead.'
)
jobType: Optional[str] = Field(
None, description='The job type of the specified lead.'
)
postalCode: Optional[str] = Field(
None, description='The postal code of the customer who created the lead.'
)
class GoogleAdsHomeservicesLocalservicesV1PhoneLead(BaseModel):
chargedCallTimestamp: Optional[str] = Field(
None,
description='Timestamp of the phone call which resulted in a charged phone lead.',
)
chargedConnectedCallDurationSeconds: Optional[str] = Field(
None, description='Duration of the charged phone call in seconds.'
)
consumerPhoneNumber: Optional[str] = Field(
None, description='Consumer phone number associated with the phone lead.'
)
class GoogleTypeTimeZone(BaseModel):
id: Optional[str] = Field(
None, description='IANA Time Zone Database time zone, e.g. "America/New_York".'
)
version: Optional[str] = Field(
None,
description='Optional. IANA Time Zone Database version number, e.g. "2019a".',
)
class FieldXgafv(Enum):
field_1 = '1'
field_2 = '2'
class Alt(Enum):
json = 'json'
media = 'media'
proto = 'proto'
class GoogleAdsHomeservicesLocalservicesV1AccountReport(BaseModel):
accountId: Optional[str] = Field(
None, description='Unique identifier of the GLS account.'
)
aggregatorInfo: Optional[GoogleAdsHomeservicesLocalservicesV1AggregatorInfo] = (
Field(
None, description='Aggregator specific information related to the account.'
)
)
averageFiveStarRating: Optional[float] = Field(
None, description='Average review rating score from 1-5 stars.'
)
averageWeeklyBudget: Optional[float] = Field(
None, description='Average weekly budget in the currency code of the account.'
)
businessName: Optional[str] = Field(
None, description='Business name of the account.'
)
currencyCode: Optional[str] = Field(
None, description='Currency code of the account.'
)
currentPeriodChargedLeads: Optional[str] = Field(
None,
description='Number of charged leads the account received in current specified period.',
)
currentPeriodConnectedPhoneCalls: Optional[str] = Field(
None,
description='Number of connected phone calls (duration over 30s) in current specified period.',
)
currentPeriodPhoneCalls: Optional[str] = Field(
None,
description='Number of phone calls in current specified period, including both connected and unconnected calls.',
)
currentPeriodTotalCost: Optional[float] = Field(
None,
description="Total cost of the account in current specified period in the account's specified currency.",
)
impressionsLastTwoDays: Optional[str] = Field(
None,
description='Number of impressions that customers have had in the past 2 days.',
)
phoneLeadResponsiveness: Optional[float] = Field(
None,
description='Phone lead responsiveness of the account for the past 90 days from current date. This is computed by taking the total number of connected calls from charged phone leads and dividing by the total number of calls received.',
)
previousPeriodChargedLeads: Optional[str] = Field(
None,
description='Number of charged leads the account received in previous specified period.',
)
previousPeriodConnectedPhoneCalls: Optional[str] = Field(
None,
description='Number of connected phone calls (duration over 30s) in previous specified period.',
)
previousPeriodPhoneCalls: Optional[str] = Field(
None,
description='Number of phone calls in previous specified period, including both connected and unconnected calls.',
)
previousPeriodTotalCost: Optional[float] = Field(
None,
description="Total cost of the account in previous specified period in the account's specified currency.",
)
totalReview: Optional[int] = Field(
None, description='Total number of reviews the account has up to current date.'
)
class GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport(BaseModel):
accountId: Optional[str] = Field(
None, description='Identifies account that received the lead.'
)
aggregatorInfo: Optional[GoogleAdsHomeservicesLocalservicesV1AggregatorInfo] = (
Field(None, description='Aggregator specific information related to the lead.')
)
bookingLead: Optional[GoogleAdsHomeservicesLocalservicesV1BookingLead] = Field(
None, description='More information associated to only booking leads.'
)
businessName: Optional[str] = Field(
None, description='Business name associated to the account.'
)
chargeStatus: Optional[ChargeStatus] = Field(
None, description='Whether the lead has been charged.'
)
currencyCode: Optional[str] = Field(None, description='Currency code.')
disputeStatus: Optional[str] = Field(
None, description='Dispute status related to the lead.'
)
geo: Optional[str] = Field(
None, description="Location of the associated account's home city."
)
leadCategory: Optional[str] = Field(
None, description='Lead category (e.g. hvac, plumber)'
)
leadCreationTimestamp: Optional[str] = Field(
None, description='Timestamp of when the lead was created.'
)
leadId: Optional[str] = Field(
None, description='Unique identifier of a Detailed Lead Report.'
)
leadPrice: Optional[float] = Field(
None,
description='Price of the lead (available only after it has been charged).',
)
leadType: Optional[LeadType] = Field(None, description='Lead type.')
messageLead: Optional[GoogleAdsHomeservicesLocalservicesV1MessageLead] = Field(
None, description='More information associated to only message leads.'
)
phoneLead: Optional[GoogleAdsHomeservicesLocalservicesV1PhoneLead] = Field(
None, description='More information associated to only phone leads.'
)
timezone: Optional[GoogleTypeTimeZone] = Field(
None, description='Timezone of the particular provider associated to a lead.'
)
class GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse(BaseModel):
accountReports: Optional[
List[GoogleAdsHomeservicesLocalservicesV1AccountReport]
] = Field(
None,
description='List of account reports which maps 1:1 to a particular linked GLS account.',
)
nextPageToken: Optional[str] = Field(
None,
description='Pagination token to retrieve the next page of results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set.',
)
class GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse(BaseModel):
detailedLeadReports: Optional[
List[GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport]
] = Field(
None,
description='List of detailed lead reports uniquely identified by external lead id.',
)
nextPageToken: Optional[str] = Field(
None,
description='Pagination token to retrieve the next page of results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set.',
)