# generated by fastapi-codegen:
#   filename:  /Users/ivasylen/Code/contracts/guardicore/connector
#   timestamp: 2026-01-26T10:59:30+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 Action(Enum):
    REGISTER = 'register'
    TEST = 'test'


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'
    )
    action: Action = Field(
        ...,
        description='Action to perform - register accounts or test assume role existence',
    )


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 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')
