# This file is autogenerated by `applaudgen` from `app_store_connect_api.json`.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!

import requests
from deprecated import deprecated
from typing import Union, Optional, Literal, Iterator
from .enums import *
from .models import *
from .requests import *
from pydantic import Field

class GzipResponse:

    def __init__(self, response: requests.Response):
        import zlib
        self.response = response

        self.default_gzip_filename = response.headers.get('x-reports-filename') or response.headers['Content-Disposition'].split('filename=')[1].strip('"')
            
        if self.default_gzip_filename.endswith('.gz'):
            self.default_extract_filename = self.default_gzip_filename[:-3]
        else:
            self.default_extract_filename = None

        self._decompressor = zlib.decompressobj(16+zlib.MAX_WBITS)

    def decompress(self) -> bytes:
        '''Decompresses the gzip content in response.'''
        return self._decompressor.decompress(self.response.content)

    def save(self, filename: Optional[str]=None, *, decompress: bool=False):
        '''Saves or extracts the gzip content to a file.

        :param filename: the filename to save to. If not specified, the filename will be the value of the  `x-reports-filename` or `Content-Disposition` header.
        :type filename: str = None
        :param decompress: if True, the content will be extracted to a file. If False, the content will be saved to a file.
        '''
        filename = filename or (self.default_extract_filename if decompress else self.default_gzip_filename)

        with open(filename, 'wb') as out:
            if decompress:
                out.write(self._decompressor.decompress(self.response.content))
            else:
                out.write(self.response.content)

class GzipStreamResponse(GzipResponse):

    CHUNKSIZE: int = 1024

    def iter_decompress(self, chunk_size: Optional[int]=None) -> Iterator[bytes]:
        '''Iterates over the response data and decompress it.

        :param chunk_size: the size of the chunks to yield. chunk_size must be of type int or None. If chunk_size is None, the default value of GzipStreamResponse.CHUNKSIZE will be used.
        :type chunk_size: int = None
        '''
        while True:
            data = self.response.raw.read(chunk_size or self.CHUNKSIZE)
            if not data:
                yield self._decompressor.flush()
                break

            yield self._decompressor.decompress(data)

    def save(self, filename: Optional[str]=None, *, decompress: bool=False):
        '''Saves or extracts the gzip content to a file.

        :param filename: the filename to save to. If not specified, the filename will be the value of the  `x-reports-filename` or `Content-Disposition` header.
        :type filename: str = None
        :param decompress: if True, the content will be extracted to a file. If False, the content will be saved to a file.
        '''
        filename = filename or (self.default_extract_filename if decompress else self.default_gzip_filename)

        with open(filename, 'wb') as out:
            if decompress:
                for decompressed in self.iter_decompress(self.CHUNKSIZE):
                    out.write(decompressed)
            else:
                for chunk in self.response.iter_content(self.CHUNKSIZE):
                    out.write(chunk)

class JSONResponse(ApplaudModel):
    pass

class AgeRatingDeclarationResponse(JSONResponse):
    data: AgeRatingDeclaration
    links: DocumentLinks

class AppCategoriesResponse(JSONResponse):
    data: list[AppCategory]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppCategory, AppCategory]]]
    meta: Optional[PagingInformation]

class AppCategoryResponse(JSONResponse):
    data: AppCategory
    links: DocumentLinks
    included: Optional[list[Union[AppCategory, AppCategory]]]

class AppClipAdvancedExperienceImageResponse(JSONResponse):
    data: AppClipAdvancedExperienceImage
    links: DocumentLinks

class AppClipAdvancedExperiencesResponse(JSONResponse):
    data: list[AppClipAdvancedExperience]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppClip, AppClipAdvancedExperienceImage, AppClipAdvancedExperienceLocalization]]]
    meta: Optional[PagingInformation]

class AppClipAdvancedExperienceResponse(JSONResponse):
    data: AppClipAdvancedExperience
    links: DocumentLinks
    included: Optional[list[Union[AppClip, AppClipAdvancedExperienceImage, AppClipAdvancedExperienceLocalization]]]

class AppClipAppStoreReviewDetailResponse(JSONResponse):
    data: AppClipAppStoreReviewDetail
    links: DocumentLinks
    included: Optional[list[AppClipDefaultExperience]]

class AppClipDefaultExperienceLocalizationsResponse(JSONResponse):
    data: list[AppClipDefaultExperienceLocalization]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppClipDefaultExperience, AppClipHeaderImage]]]
    meta: Optional[PagingInformation]

class AppClipDefaultExperienceLocalizationResponse(JSONResponse):
    data: AppClipDefaultExperienceLocalization
    links: DocumentLinks
    included: Optional[list[Union[AppClipDefaultExperience, AppClipHeaderImage]]]

class AppClipDefaultExperiencesResponse(JSONResponse):
    data: list[AppClipDefaultExperience]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppClip, AppStoreVersion, AppClipDefaultExperienceLocalization, AppClipAppStoreReviewDetail]]]
    meta: Optional[PagingInformation]

class AppClipDefaultExperienceResponse(JSONResponse):
    data: AppClipDefaultExperience
    links: DocumentLinks
    included: Optional[list[Union[AppClip, AppStoreVersion, AppClipDefaultExperienceLocalization, AppClipAppStoreReviewDetail]]]

class AppClipDomainStatusResponse(JSONResponse):
    data: AppClipDomainStatus
    links: DocumentLinks

class AppClipHeaderImageResponse(JSONResponse):
    data: AppClipHeaderImage
    links: DocumentLinks
    included: Optional[list[AppClipDefaultExperienceLocalization]]

class AppClipsResponse(JSONResponse):
    data: list[AppClip]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, AppClipDefaultExperience]]]
    meta: Optional[PagingInformation]

class AppClipResponse(JSONResponse):
    data: AppClip
    links: DocumentLinks
    included: Optional[list[Union[App, AppClipDefaultExperience]]]

class AppEncryptionDeclarationsResponse(JSONResponse):
    data: list[AppEncryptionDeclaration]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class AppEncryptionDeclarationResponse(JSONResponse):
    data: AppEncryptionDeclaration
    links: DocumentLinks
    included: Optional[list[App]]

class AppInfoLocalizationsResponse(JSONResponse):
    data: list[AppInfoLocalization]
    links: PagedDocumentLinks
    included: Optional[list[AppInfo]]
    meta: Optional[PagingInformation]

class AppInfoLocalizationResponse(JSONResponse):
    data: AppInfoLocalization
    links: DocumentLinks
    included: Optional[list[AppInfo]]

class AppInfosResponse(JSONResponse):
    data: list[AppInfo]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, AgeRatingDeclaration, AppInfoLocalization, AppCategory, AppCategory, AppCategory, AppCategory, AppCategory, AppCategory]]]
    meta: Optional[PagingInformation]

class AppInfoResponse(JSONResponse):
    data: AppInfo
    links: DocumentLinks
    included: Optional[list[Union[App, AgeRatingDeclaration, AppInfoLocalization, AppCategory, AppCategory, AppCategory, AppCategory, AppCategory, AppCategory]]]

class AppPreOrderResponse(JSONResponse):
    data: AppPreOrder
    links: DocumentLinks
    included: Optional[list[App]]

class AppPreviewSetsResponse(JSONResponse):
    data: list[AppPreviewSet]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppStoreVersionLocalization, AppPreview]]]
    meta: Optional[PagingInformation]

class AppPreviewSetResponse(JSONResponse):
    data: AppPreviewSet
    links: DocumentLinks
    included: Optional[list[Union[AppStoreVersionLocalization, AppPreview]]]

class AppPreviewsResponse(JSONResponse):
    data: list[AppPreview]
    links: PagedDocumentLinks
    included: Optional[list[AppPreviewSet]]
    meta: Optional[PagingInformation]

class AppPreviewResponse(JSONResponse):
    data: AppPreview
    links: DocumentLinks
    included: Optional[list[AppPreviewSet]]

class AppPricePointsResponse(JSONResponse):
    data: list[AppPricePoint]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppPriceTier, Territory]]]
    meta: Optional[PagingInformation]

class AppPricePointResponse(JSONResponse):
    data: AppPricePoint
    links: DocumentLinks
    included: Optional[list[Union[AppPriceTier, Territory]]]

class AppPriceTiersResponse(JSONResponse):
    data: list[AppPriceTier]
    links: PagedDocumentLinks
    included: Optional[list[AppPricePoint]]
    meta: Optional[PagingInformation]

class AppPriceTierResponse(JSONResponse):
    data: AppPriceTier
    links: DocumentLinks
    included: Optional[list[AppPricePoint]]

class AppPricesResponse(JSONResponse):
    data: list[AppPrice]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, AppPriceTier]]]
    meta: Optional[PagingInformation]

class AppPriceResponse(JSONResponse):
    data: AppPrice
    links: DocumentLinks
    included: Optional[list[Union[App, AppPriceTier]]]

class AppScreenshotSetsResponse(JSONResponse):
    data: list[AppScreenshotSet]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppStoreVersionLocalization, AppScreenshot]]]
    meta: Optional[PagingInformation]

class AppScreenshotSetResponse(JSONResponse):
    data: AppScreenshotSet
    links: DocumentLinks
    included: Optional[list[Union[AppStoreVersionLocalization, AppScreenshot]]]

class AppScreenshotsResponse(JSONResponse):
    data: list[AppScreenshot]
    links: PagedDocumentLinks
    included: Optional[list[AppScreenshotSet]]
    meta: Optional[PagingInformation]

class AppScreenshotResponse(JSONResponse):
    data: AppScreenshot
    links: DocumentLinks
    included: Optional[list[AppScreenshotSet]]

class AppStoreReviewAttachmentsResponse(JSONResponse):
    data: list[AppStoreReviewAttachment]
    links: PagedDocumentLinks
    included: Optional[list[AppStoreReviewDetail]]
    meta: Optional[PagingInformation]

class AppStoreReviewAttachmentResponse(JSONResponse):
    data: AppStoreReviewAttachment
    links: DocumentLinks
    included: Optional[list[AppStoreReviewDetail]]

class AppStoreReviewDetailResponse(JSONResponse):
    data: AppStoreReviewDetail
    links: DocumentLinks
    included: Optional[list[Union[AppStoreVersion, AppStoreReviewAttachment]]]

class AppStoreVersionLocalizationsResponse(JSONResponse):
    data: list[AppStoreVersionLocalization]
    links: PagedDocumentLinks
    included: Optional[list[Union[AppStoreVersion, AppScreenshotSet, AppPreviewSet]]]
    meta: Optional[PagingInformation]

class AppStoreVersionLocalizationResponse(JSONResponse):
    data: AppStoreVersionLocalization
    links: DocumentLinks
    included: Optional[list[Union[AppStoreVersion, AppScreenshotSet, AppPreviewSet]]]

class AppStoreVersionPhasedReleaseResponse(JSONResponse):
    data: AppStoreVersionPhasedRelease
    links: DocumentLinks

class AppStoreVersionReleaseRequestResponse(JSONResponse):
    data: AppStoreVersionReleaseRequest
    links: DocumentLinks

class AppStoreVersionSubmissionResponse(JSONResponse):
    data: AppStoreVersionSubmission
    links: DocumentLinks
    included: Optional[list[AppStoreVersion]]

class AppStoreVersionsResponse(JSONResponse):
    data: list[AppStoreVersion]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, AgeRatingDeclaration, AppStoreVersionLocalization, Build, AppStoreVersionPhasedRelease, RoutingAppCoverage, AppStoreReviewDetail, AppStoreVersionSubmission, IdfaDeclaration, AppClipDefaultExperience]]]
    meta: Optional[PagingInformation]

class AppStoreVersionResponse(JSONResponse):
    data: AppStoreVersion
    links: DocumentLinks
    included: Optional[list[Union[App, AgeRatingDeclaration, AppStoreVersionLocalization, Build, AppStoreVersionPhasedRelease, RoutingAppCoverage, AppStoreReviewDetail, AppStoreVersionSubmission, IdfaDeclaration, AppClipDefaultExperience]]]

class AppsResponse(JSONResponse):
    data: list[App]
    links: PagedDocumentLinks
    included: Optional[list[Union[CiProduct, BetaGroup, AppStoreVersion, PrereleaseVersion, BetaAppLocalization, Build, BetaLicenseAgreement, BetaAppReviewDetail, AppInfo, AppClip, EndUserLicenseAgreement, AppPreOrder, AppPrice, Territory, InAppPurchase, GameCenterEnabledVersion]]]
    meta: Optional[PagingInformation]

class AppResponse(JSONResponse):
    data: App
    links: DocumentLinks
    included: Optional[list[Union[CiProduct, BetaGroup, AppStoreVersion, PrereleaseVersion, BetaAppLocalization, Build, BetaLicenseAgreement, BetaAppReviewDetail, AppInfo, AppClip, EndUserLicenseAgreement, AppPreOrder, AppPrice, Territory, InAppPurchase, GameCenterEnabledVersion]]]

class BetaAppClipInvocationLocalizationResponse(JSONResponse):
    data: BetaAppClipInvocationLocalization
    links: DocumentLinks

class BetaAppClipInvocationsResponse(JSONResponse):
    data: list[BetaAppClipInvocation]
    links: PagedDocumentLinks
    included: Optional[list[BetaAppClipInvocationLocalization]]
    meta: Optional[PagingInformation]

class BetaAppClipInvocationResponse(JSONResponse):
    data: BetaAppClipInvocation
    links: DocumentLinks
    included: Optional[list[BetaAppClipInvocationLocalization]]

class BetaAppLocalizationsResponse(JSONResponse):
    data: list[BetaAppLocalization]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class BetaAppLocalizationResponse(JSONResponse):
    data: BetaAppLocalization
    links: DocumentLinks
    included: Optional[list[App]]

class BetaAppReviewDetailsResponse(JSONResponse):
    data: list[BetaAppReviewDetail]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class BetaAppReviewDetailResponse(JSONResponse):
    data: BetaAppReviewDetail
    links: DocumentLinks
    included: Optional[list[App]]

class BetaAppReviewSubmissionsResponse(JSONResponse):
    data: list[BetaAppReviewSubmission]
    links: PagedDocumentLinks
    included: Optional[list[Build]]
    meta: Optional[PagingInformation]

class BetaAppReviewSubmissionResponse(JSONResponse):
    data: BetaAppReviewSubmission
    links: DocumentLinks
    included: Optional[list[Build]]

class BetaBuildLocalizationsResponse(JSONResponse):
    data: list[BetaBuildLocalization]
    links: PagedDocumentLinks
    included: Optional[list[Build]]
    meta: Optional[PagingInformation]

class BetaBuildLocalizationResponse(JSONResponse):
    data: BetaBuildLocalization
    links: DocumentLinks
    included: Optional[list[Build]]

class BetaGroupsResponse(JSONResponse):
    data: list[BetaGroup]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, Build, BetaTester]]]
    meta: Optional[PagingInformation]

class BetaGroupResponse(JSONResponse):
    data: BetaGroup
    links: DocumentLinks
    included: Optional[list[Union[App, Build, BetaTester]]]

class BetaLicenseAgreementsResponse(JSONResponse):
    data: list[BetaLicenseAgreement]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class BetaLicenseAgreementResponse(JSONResponse):
    data: BetaLicenseAgreement
    links: DocumentLinks
    included: Optional[list[App]]

class BetaTesterInvitationResponse(JSONResponse):
    data: BetaTesterInvitation
    links: DocumentLinks

class BetaTestersResponse(JSONResponse):
    data: list[BetaTester]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, BetaGroup, Build]]]
    meta: Optional[PagingInformation]

class BetaTesterResponse(JSONResponse):
    data: BetaTester
    links: DocumentLinks
    included: Optional[list[Union[App, BetaGroup, Build]]]

class BuildBetaDetailsResponse(JSONResponse):
    data: list[BuildBetaDetail]
    links: PagedDocumentLinks
    included: Optional[list[Build]]
    meta: Optional[PagingInformation]

class BuildBetaDetailResponse(JSONResponse):
    data: BuildBetaDetail
    links: DocumentLinks
    included: Optional[list[Build]]

class BuildBetaNotificationResponse(JSONResponse):
    data: BuildBetaNotification
    links: DocumentLinks

class BuildBundleFileSizesResponse(JSONResponse):
    data: list[BuildBundleFileSize]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BuildIconsResponse(JSONResponse):
    data: list[BuildIcon]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BuildsResponse(JSONResponse):
    data: list[Build]
    links: PagedDocumentLinks
    included: Optional[list[Union[PrereleaseVersion, BetaTester, BetaBuildLocalization, AppEncryptionDeclaration, BetaAppReviewSubmission, App, BuildBetaDetail, AppStoreVersion, BuildIcon, BuildBundle]]]
    meta: Optional[PagingInformation]

class BuildResponse(JSONResponse):
    data: Build
    links: DocumentLinks
    included: Optional[list[Union[PrereleaseVersion, BetaTester, BetaBuildLocalization, AppEncryptionDeclaration, BetaAppReviewSubmission, App, BuildBetaDetail, AppStoreVersion, BuildIcon, BuildBundle]]]

class BundleIdCapabilitiesResponse(JSONResponse):
    data: list[BundleIdCapability]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BundleIdCapabilityResponse(JSONResponse):
    data: BundleIdCapability
    links: DocumentLinks

class BundleIdsResponse(JSONResponse):
    data: list[BundleId]
    links: PagedDocumentLinks
    included: Optional[list[Union[Profile, BundleIdCapability, App]]]
    meta: Optional[PagingInformation]

class BundleIdResponse(JSONResponse):
    data: BundleId
    links: DocumentLinks
    included: Optional[list[Union[Profile, BundleIdCapability, App]]]

class CertificatesResponse(JSONResponse):
    data: list[Certificate]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class CertificateResponse(JSONResponse):
    data: Certificate
    links: DocumentLinks

class CiArtifactsResponse(JSONResponse):
    data: list[CiArtifact]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class CiArtifactResponse(JSONResponse):
    data: CiArtifact
    links: DocumentLinks

class CiBuildActionsResponse(JSONResponse):
    data: list[CiBuildAction]
    links: PagedDocumentLinks
    included: Optional[list[CiBuildRun]]
    meta: Optional[PagingInformation]

class CiBuildActionResponse(JSONResponse):
    data: CiBuildAction
    links: DocumentLinks
    included: Optional[list[CiBuildRun]]

class CiBuildRunsResponse(JSONResponse):
    data: list[CiBuildRun]
    links: PagedDocumentLinks
    included: Optional[list[Union[Build, CiWorkflow, CiProduct, ScmGitReference, ScmGitReference, ScmPullRequest]]]
    meta: Optional[PagingInformation]

class CiBuildRunResponse(JSONResponse):
    data: CiBuildRun
    links: DocumentLinks
    included: Optional[list[Union[Build, CiWorkflow, CiProduct, ScmGitReference, ScmGitReference, ScmPullRequest]]]

class CiIssuesResponse(JSONResponse):
    data: list[CiIssue]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class CiIssueResponse(JSONResponse):
    data: CiIssue
    links: DocumentLinks

class CiMacOsVersionsResponse(JSONResponse):
    data: list[CiMacOsVersion]
    links: PagedDocumentLinks
    included: Optional[list[CiXcodeVersion]]
    meta: Optional[PagingInformation]

class CiMacOsVersionResponse(JSONResponse):
    data: CiMacOsVersion
    links: DocumentLinks
    included: Optional[list[CiXcodeVersion]]

class CiProductsResponse(JSONResponse):
    data: list[CiProduct]
    links: PagedDocumentLinks
    included: Optional[list[Union[App, BundleId, ScmRepository]]]
    meta: Optional[PagingInformation]

class CiProductResponse(JSONResponse):
    data: CiProduct
    links: DocumentLinks
    included: Optional[list[Union[App, BundleId, ScmRepository]]]

class CiTestResultsResponse(JSONResponse):
    data: list[CiTestResult]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class CiTestResultResponse(JSONResponse):
    data: CiTestResult
    links: DocumentLinks

class CiWorkflowsResponse(JSONResponse):
    data: list[CiWorkflow]
    links: PagedDocumentLinks
    included: Optional[list[Union[CiProduct, ScmRepository, CiXcodeVersion, CiMacOsVersion]]]
    meta: Optional[PagingInformation]

class CiWorkflowResponse(JSONResponse):
    data: CiWorkflow
    links: DocumentLinks
    included: Optional[list[Union[CiProduct, ScmRepository, CiXcodeVersion, CiMacOsVersion]]]

class CiXcodeVersionsResponse(JSONResponse):
    data: list[CiXcodeVersion]
    links: PagedDocumentLinks
    included: Optional[list[CiMacOsVersion]]
    meta: Optional[PagingInformation]

class CiXcodeVersionResponse(JSONResponse):
    data: CiXcodeVersion
    links: DocumentLinks
    included: Optional[list[CiMacOsVersion]]

class DevicesResponse(JSONResponse):
    data: list[Device]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class DeviceResponse(JSONResponse):
    data: Device
    links: DocumentLinks

class DiagnosticLogsResponse(JSONResponse):
    data: list[DiagnosticLog]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class DiagnosticSignaturesResponse(JSONResponse):
    data: list[DiagnosticSignature]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class EndUserLicenseAgreementResponse(JSONResponse):
    data: EndUserLicenseAgreement
    links: DocumentLinks
    included: Optional[list[Union[App, Territory]]]

class GameCenterEnabledVersionsResponse(JSONResponse):
    data: list[GameCenterEnabledVersion]
    links: PagedDocumentLinks
    included: Optional[list[Union[GameCenterEnabledVersion, App]]]
    meta: Optional[PagingInformation]

@deprecated
class IdfaDeclarationResponse(JSONResponse):
    data: IdfaDeclaration
    links: DocumentLinks
    included: Optional[list[AppStoreVersion]]

class InAppPurchasesResponse(JSONResponse):
    data: list[InAppPurchase]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class InAppPurchaseResponse(JSONResponse):
    data: InAppPurchase
    links: DocumentLinks
    included: Optional[list[App]]

class PerfPowerMetricsResponse(JSONResponse):
    data: list[PerfPowerMetric]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class PreReleaseVersionsResponse(JSONResponse):
    data: list[PrereleaseVersion]
    links: PagedDocumentLinks
    included: Optional[list[Union[Build, App]]]
    meta: Optional[PagingInformation]

class PrereleaseVersionResponse(JSONResponse):
    data: PrereleaseVersion
    links: DocumentLinks
    included: Optional[list[Union[Build, App]]]

class ProfilesResponse(JSONResponse):
    data: list[Profile]
    links: PagedDocumentLinks
    included: Optional[list[Union[BundleId, Device, Certificate]]]
    meta: Optional[PagingInformation]

class ProfileResponse(JSONResponse):
    data: Profile
    links: DocumentLinks
    included: Optional[list[Union[BundleId, Device, Certificate]]]

class RoutingAppCoverageResponse(JSONResponse):
    data: RoutingAppCoverage
    links: DocumentLinks
    included: Optional[list[AppStoreVersion]]

class ScmGitReferencesResponse(JSONResponse):
    data: list[ScmGitReference]
    links: PagedDocumentLinks
    included: Optional[list[ScmRepository]]
    meta: Optional[PagingInformation]

class ScmGitReferenceResponse(JSONResponse):
    data: ScmGitReference
    links: DocumentLinks
    included: Optional[list[ScmRepository]]

class ScmProvidersResponse(JSONResponse):
    data: list[ScmProvider]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class ScmProviderResponse(JSONResponse):
    data: ScmProvider
    links: DocumentLinks

class ScmPullRequestsResponse(JSONResponse):
    data: list[ScmPullRequest]
    links: PagedDocumentLinks
    included: Optional[list[ScmRepository]]
    meta: Optional[PagingInformation]

class ScmPullRequestResponse(JSONResponse):
    data: ScmPullRequest
    links: DocumentLinks
    included: Optional[list[ScmRepository]]

class ScmRepositoriesResponse(JSONResponse):
    data: list[ScmRepository]
    links: PagedDocumentLinks
    included: Optional[list[Union[ScmProvider, ScmGitReference]]]
    meta: Optional[PagingInformation]

class ScmRepositoryResponse(JSONResponse):
    data: ScmRepository
    links: DocumentLinks
    included: Optional[list[Union[ScmProvider, ScmGitReference]]]

class TerritoriesResponse(JSONResponse):
    data: list[Territory]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class TerritoryResponse(JSONResponse):
    data: Territory
    links: DocumentLinks

class UserInvitationsResponse(JSONResponse):
    data: list[UserInvitation]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class UserInvitationResponse(JSONResponse):
    data: UserInvitation
    links: DocumentLinks
    included: Optional[list[App]]

class UsersResponse(JSONResponse):
    data: list[User]
    links: PagedDocumentLinks
    included: Optional[list[App]]
    meta: Optional[PagingInformation]

class UserResponse(JSONResponse):
    data: User
    links: DocumentLinks
    included: Optional[list[App]]

class AppClipDefaultExperienceReleaseWithAppStoreVersionLinkageResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["appStoreVersions"] = "appStoreVersions"

    data: Data
    links: DocumentLinks

class AppPreviewSetAppPreviewsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["appPreviews"] = "appPreviews"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class AppScreenshotSetAppScreenshotsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["appScreenshots"] = "appScreenshots"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class AppStoreVersionAppClipDefaultExperienceLinkageResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["appClipDefaultExperiences"] = "appClipDefaultExperiences"

    data: Data
    links: DocumentLinks

class AppStoreVersionBuildLinkageResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["builds"] = "builds"

    data: Data
    links: DocumentLinks

class BetaGroupBetaTestersLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["betaTesters"] = "betaTesters"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BetaGroupBuildsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["builds"] = "builds"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BetaTesterAppsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["apps"] = "apps"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BetaTesterBetaGroupsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["betaGroups"] = "betaGroups"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BetaTesterBuildsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["builds"] = "builds"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class BuildAppEncryptionDeclarationLinkageResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["appEncryptionDeclarations"] = "appEncryptionDeclarations"

    data: Data
    links: DocumentLinks

class BuildIndividualTestersLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["betaTesters"] = "betaTesters"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class GameCenterEnabledVersionCompatibleVersionsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["gameCenterEnabledVersions"] = "gameCenterEnabledVersions"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class UserVisibleAppsLinkagesResponse(JSONResponse):
    class Data(ApplaudModel):
        id: str
        type: Literal["apps"] = "apps"

    data: list[Data]
    links: PagedDocumentLinks
    meta: Optional[PagingInformation]

class ErrorResponse(JSONResponse):
    class Error(ApplaudModel):
        code: str
        detail: str
        title: str
        status: str
        id: Optional[str]
        source: Optional[Union[ErrorSourcePointer, ErrorSourceParameter]]

    errors: Optional[list[Error]]


