# generated by fastapi-codegen:
#   filename:  /Users/jgopalak/Documents/projects/contracts/guardicore/connector
#   timestamp: 2026-03-12T06:37:37+00:00

from __future__ import annotations

from enum import Enum
from typing import List

from pydantic import BaseModel, ConfigDict, Field

from centra_sdk.utils.gc_serializer import GcSerializer


class AccountRegistration(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    assume_role_name: str = Field(
        ..., alias='assume-role-name', description='Name of the Assume role'
    )
    account_ids: List[str] = Field(
        ..., alias='account-ids', description='List of AWS account IDs'
    )


class InvalidAccountsResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    invalid_accounts: List[str] = Field(
        ..., alias='invalid-accounts', description='List of invalid AWS account IDs'
    )


class RegisteredAccountsResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    message: str = Field(..., description='All accounts registered successfully')


class OrganizationRegistration(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    assume_role_name: str = Field(
        ..., alias='assume-role-name', description='Name of the Assume role'
    )
    ou_role_arn: str = Field(
        ...,
        alias='ou-role-arn',
        description='ARN of the OU role used to register the AWS organization',
    )


class RegisteredOrganizationResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    message: str = Field(..., description='Organization registered successfully')


class InvalidOrganizationResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    message: str = Field(..., description='Invalid OU role ARN provided')


class OUReaderRolePermissionError(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    message: str = Field(
        ...,
        description='Error message describing permission or delegation issues with the OU reader role',
    )


class OrganizationRegistrationErrorResponse(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    message: str = Field(
        ...,
        description='Error message when there are no accounts to register or the assume role is not present in any of the accounts',
    )


class OperationMode(Enum):
    REVEAL = 'reveal'
    REVEAL_AND_ENFORCEMENT = 'reveal_and_enforcement'


class Scope(Enum):
    ORG_UNITS = 'org_units'
    ACCOUNTS = 'accounts'


class AssumeRoleTemplateRequest(BaseModel, GcSerializer):
    model_config = ConfigDict(
        populate_by_name=True,
        from_attributes=True,
    )
    operation_mode: OperationMode = Field(
        ..., alias='operation-mode', description='Operation mode for the templates'
    )
    scope: Scope = Field(..., description='Scope for the templates')
