Models
The Community DevOps Agent API uses Pydantic models for data validation and type safety.
Overview
All API responses and request data are validated using Pydantic models, providing:
Type Safety: Runtime type checking and validation
IDE Support: Autocomplete and type hints
Data Validation: Automatic validation of API responses
Serialization: Easy conversion to/from JSON
Core Models
Pydantic data models for the DevOps Agent API.
This module provides type-safe Python models for all API operations, enabling validation, serialization, and IDE autocomplete support.
- class devopsagent_api.models.TaskStatus(value)[source]
Bases:
str,EnumTask execution status.
- PENDING_START = 'PENDING_START'
- IN_PROGRESS = 'IN_PROGRESS'
- COMPLETED = 'COMPLETED'
- FAILED = 'FAILED'
- CANCELLED = 'CANCELLED'
- CANCELLED_ALT = 'CANCELLED'
- TIMED_OUT = 'TIMED_OUT'
- PENDING_CUSTOMER_APPROVAL = 'PENDING_CUSTOMER_APPROVAL'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.TaskType(value)[source]
Bases:
str,EnumType of task.
- INVESTIGATION = 'INVESTIGATION'
- EVALUATION = 'EVALUATION'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.TaskPriority(value)[source]
Bases:
str,EnumTask priority level.
- CRITICAL = 'CRITICAL'
- HIGH = 'HIGH'
- MEDIUM = 'MEDIUM'
- LOW = 'LOW'
- MINIMAL = 'MINIMAL'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.GoalType(value)[source]
Bases:
str,EnumType of automated goal/workflow.
- CUSTOMER_DEFINED = 'CUSTOMER_DEFINED'
- ONCALL_REPORT = 'ONCALL_REPORT'
- PREDEFINED = 'PREDEFINED'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.GoalStatus(value)[source]
Bases:
str,EnumGoal execution status.
- ACTIVE = 'ACTIVE'
- COMPLETE = 'COMPLETE'
- PAUSED = 'PAUSED'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.RecommendationStatus(value)[source]
Bases:
str,EnumRecommendation status.
- PROPOSED = 'PROPOSED'
- ACCEPTED = 'ACCEPTED'
- REJECTED = 'REJECTED'
- CLOSED = 'CLOSED'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.JournalRecordType(value)[source]
Bases:
str,EnumType of journal record.
- MESSAGE = 'message'
- PLAN = 'plan'
- ACTIVITY = 'activity'
- OBSERVATION = 'observation'
- SYMPTOM = 'symptom'
- FINDING = 'finding'
- INVESTIGATION_SUMMARY = 'investigation_summary'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.SortField(value)[source]
Bases:
str,EnumField to sort results by.
- CREATED_AT = 'CREATED_AT'
- UPDATED_AT = 'UPDATED_AT'
- PRIORITY = 'PRIORITY'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.SortOrder(value)[source]
Bases:
str,EnumSort direction.
- ASC = 'ASC'
- DESC = 'DESC'
- __format__(format_spec)
Returns format using actual value type unless __str__ has been overridden.
- class devopsagent_api.models.Metadata[source]
Bases:
BaseModelGeneric metadata container.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Reference(*, system: str | None = None, id: str | None = None)[source]
Bases:
BaseModelReference to external system.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- system: str | None
- id: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportMetadata(*, case_id: str | None = None, visual_id: str | None = None, case_url: str | None = None)[source]
Bases:
BaseModelSupport case metadata.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- case_id: str | None
- visual_id: str | None
- case_url: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.PaginationInfo(*, next_token: str | None = None, has_more: bool = False, total_count: int | None = None)[source]
Bases:
BaseModelPagination metadata.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- has_more: bool
- total_count: int | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Task(*, agent_space_id: str, task_id: str, execution_id: str | None = None, title: Annotated[str, MinLen(min_length=1), MaxLen(max_length=500)], description: Annotated[str, MaxLen(max_length=5000)], task_type: TaskType, priority: TaskPriority = TaskPriority.MEDIUM, status: TaskStatus, created_at: str, updated_at: str, version: Annotated[int, Ge(ge=0)], metadata: Metadata | None = None, reference: Reference | None = None, support_metadata: SupportMetadata | None = None)[source]
Bases:
BaseModelComplete task representation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str
- execution_id: str | None
- title: str
- description: str
- priority: TaskPriority
- status: TaskStatus
- created_at: str
- updated_at: str
- version: int
- support_metadata: SupportMetadata | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskFilter(*, task_type: List[TaskType] | None = None, status: List[TaskStatus] | None = None, priority: List[TaskPriority] | None = None, created_after: str | None = None, created_before: str | None = None, updated_after: str | None = None, updated_before: str | None = None)[source]
Bases:
BaseModelFilter criteria for task queries.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- status: List[TaskStatus] | None
- priority: List[TaskPriority] | None
- created_after: str | None
- created_before: str | None
- updated_after: str | None
- updated_before: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskListRequest(*, agent_space_id: str, limit: Annotated[int | None, Ge(ge=1), Le(le=1000)] = None, next_token: str | None = None, sort_field: SortField | None = SortField.CREATED_AT, order: SortOrder | None = SortOrder.DESC, filter: TaskFilter | None = None)[source]
Bases:
BaseModelRequest for listing tasks.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- limit: int | None
- next_token: str | None
- filter: TaskFilter | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskListResponse(*, tasks: ~typing.List[~devopsagent_api.models.Task] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelResponse from task listing.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskCreateRequest(*, title: Annotated[str, MinLen(min_length=1), MaxLen(max_length=500)], description: Annotated[str, MaxLen(max_length=5000)], task_type: TaskType, priority: TaskPriority | None = TaskPriority.MEDIUM, metadata: Metadata | None = None)[source]
Bases:
BaseModelRequest to create a new task.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- title: str
- description: str
- priority: TaskPriority | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskCreateResponse(*, task: Task)[source]
Bases:
BaseModelResponse from task creation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskUpdateRequest(*, agent_space_id: str, task_id: str, task_status: TaskStatus | None = None, current_version: int | None = None, metadata: Metadata | None = None, support_metadata: SupportMetadata | None = None)[source]
Bases:
BaseModelRequest to update a task.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str
- task_status: TaskStatus | None
- current_version: int | None
- support_metadata: SupportMetadata | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TaskUpdateResponse(*, task: Task)[source]
Bases:
BaseModelResponse from task update.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Goal(*, goal_id: str, goal_type: GoalType, title: str, status: GoalStatus, execution_status: str | None = None, last_task_id: str | None = None, last_evaluated_at: str | None = None, created_at: str, updated_at: str)[source]
Bases:
BaseModelAutomated goal/workflow representation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- goal_id: str
- title: str
- status: GoalStatus
- execution_status: str | None
- last_task_id: str | None
- last_evaluated_at: str | None
- created_at: str
- updated_at: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.GoalList(*, goals: ~typing.List[~devopsagent_api.models.Goal] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelList of goals.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.GoalListRequest(*, agent_space_id: str, limit: Annotated[int | None, Ge(ge=1), Le(le=100)] = None, next_token: str | None = None, goal_type: GoalType | None = None, status: GoalStatus | None = None, execution_status: str | None = None)[source]
Bases:
BaseModelRequest for listing goals.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- limit: int | None
- next_token: str | None
- status: GoalStatus | None
- execution_status: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.GoalListResponse(*, goals: ~typing.List[~devopsagent_api.models.Goal] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelResponse from goal listing.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationSummary(*, title: str, category: str, overview: str, background: str | None = None, next_steps: str | None = None, considerations: str | None = None, action_plan: str | None = None, affected_incidents: List[str] | None = None)[source]
Bases:
BaseModelRecommendation summary content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- title: str
- category: str
- overview: str
- background: str | None
- next_steps: str | None
- considerations: str | None
- action_plan: str | None
- affected_incidents: List[str] | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationContent(*, summary: RecommendationSummary)[source]
Bases:
BaseModelRecommendation content structure.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- summary: RecommendationSummary
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Recommendation(*, recommendation_id: str, title: str, status: RecommendationStatus, priority: TaskPriority, content: RecommendationContent, goal_id: str | None = None, goal_version: int | None = None, created_at: str, updated_at: str, version: int)[source]
Bases:
BaseModelRecommendation representation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- recommendation_id: str
- title: str
- status: RecommendationStatus
- priority: TaskPriority
- content: RecommendationContent
- goal_id: str | None
- goal_version: int | None
- created_at: str
- updated_at: str
- version: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationList(*, recommendations: ~typing.List[~devopsagent_api.models.Recommendation] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelList of recommendations.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- recommendations: List[Recommendation]
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationListRequest(*, agent_space_id: str, limit: Annotated[int | None, Ge(ge=1), Le(le=100)] = None, next_token: str | None = None, task_id: str | None = None, goal_id: str | None = None, status: RecommendationStatus | None = None, priority: TaskPriority | None = None)[source]
Bases:
BaseModelRequest for listing recommendations.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- limit: int | None
- next_token: str | None
- task_id: str | None
- goal_id: str | None
- status: RecommendationStatus | None
- priority: TaskPriority | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationListResponse(*, recommendations: ~typing.List[~devopsagent_api.models.Recommendation] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelResponse from recommendation listing.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- recommendations: List[Recommendation]
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationUpdateRequest(*, agent_space_id: str, recommendation_id: str, client_token: str | None = None, status: RecommendationStatus, additional_context: str | None = None)[source]
Bases:
BaseModelRequest to update a recommendation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- recommendation_id: str
- client_token: str | None
- status: RecommendationStatus
- additional_context: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.RecommendationUpdateResponse(*, recommendation: Recommendation)[source]
Bases:
BaseModelResponse from recommendation update.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- recommendation: Recommendation
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.JournalRecordContent(*, type: str, id: str)[source]
Bases:
BaseModelBase class for journal record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- id: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.MessageContent(*, type: str = 'message', id: str, role: str, content: List[Dict[str, Any]], user_reference: str | None = None)[source]
Bases:
JournalRecordContentMessage record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- role: str
- content: List[Dict[str, Any]]
- user_reference: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.PlanContent(*, type: str = 'plan', id: str, title: str, description: str, activity_ids: ~typing.List[str] = <factory>)[source]
Bases:
JournalRecordContentPlan record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- title: str
- description: str
- activity_ids: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.ActivityContent(*, type: str = 'activity', id: str, title: str, description: str, status: str, child_activity_ids: ~typing.List[str] = <factory>)[source]
Bases:
JournalRecordContentActivity record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- title: str
- description: str
- status: str
- child_activity_ids: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.ObservationContent(*, type: str = 'observation', id: str, plan_id: str | None = None, activity_id: str | None = None, title: str, analysis: str, signals: ~typing.List[~typing.Dict[str, ~typing.Any]] = <factory>)[source]
Bases:
JournalRecordContentObservation record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- plan_id: str | None
- activity_id: str | None
- title: str
- analysis: str
- signals: List[Dict[str, Any]]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.SymptomContent(*, type: str = 'symptom', id: str, title: str, description: str, start_time: str, end_time: str | None = None)[source]
Bases:
JournalRecordContentSymptom record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- title: str
- description: str
- start_time: str
- end_time: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.FindingContent(*, type: str = 'finding', id: str, title: str, description: str, supporting_observations: ~typing.List[~typing.Any] = <factory>, cascaded_cause_ids: ~typing.List[str] = <factory>, related_resources: ~typing.List[str] = <factory>)[source]
Bases:
JournalRecordContentFinding record content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- title: str
- description: str
- supporting_observations: List[Any]
- cascaded_cause_ids: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.InvestigationSummaryContent(*, type: str = 'investigation_summary', id: str, symptoms: ~typing.List[~typing.Any] = <factory>, findings: ~typing.List[~typing.Any] = <factory>, investigation_gaps: ~typing.List[~typing.Any] = <factory>)[source]
Bases:
JournalRecordContentInvestigation summary content.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- type: str
- symptoms: List[Any]
- findings: List[Any]
- investigation_gaps: List[Any]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str
- class devopsagent_api.models.JournalRecord(*, agent_space_id: str, execution_id: str, record_id: str, content: str, created_at: float, record_type: JournalRecordType)[source]
Bases:
BaseModelJournal record entry.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- execution_id: str
- record_id: str
- content: str
- created_at: float
- record_type: JournalRecordType
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.JournalRecordList(*, records: ~typing.List[~devopsagent_api.models.JournalRecord] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelList of journal records.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- records: List[JournalRecord]
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.JournalRecordsRequest(*, agent_space_id: str, execution_id: str, record_type: JournalRecordType | None = None, order: SortOrder | None = SortOrder.ASC, limit: Annotated[int | None, Ge(ge=1), Le(le=1000)] = None, next_token: str | None = None)[source]
Bases:
BaseModelRequest for journal records.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- execution_id: str
- record_type: JournalRecordType | None
- limit: int | None
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.JournalRecordsResponse(*, records: ~typing.List[~devopsagent_api.models.JournalRecord] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelResponse from journal records query.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- records: List[JournalRecord]
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Execution(*, agent_space_id: str, execution_id: str, agent_sub_task: str, agent_type: str, created_at: float, updated_at: float, execution_status: str, uid: str | None = None)[source]
Bases:
BaseModelExecution metadata.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- execution_id: str
- agent_sub_task: str
- agent_type: str
- created_at: float
- updated_at: float
- execution_status: str
- uid: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.ExecutionList(*, executions: ~typing.List[~devopsagent_api.models.Execution] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelList of executions.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.ExecutionListRequest(*, agent_space_id: str, task_id: str | None = None, limit: Annotated[int | None, Ge(ge=1), Le(le=100)] = None, next_token: str | None = None)[source]
Bases:
BaseModelRequest for execution list.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str | None
- limit: int | None
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.ExecutionListResponse(*, executions: ~typing.List[~devopsagent_api.models.Execution] = <factory>, next_token: str | None = None)[source]
Bases:
BaseModelResponse from execution list.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- next_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.IdentifierMetadata(*, account_id: str, region: str, arn: str | None = None, name: str | None = None)[source]
Bases:
BaseModelResource identifier metadata.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- account_id: str
- region: str
- arn: str | None
- name: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TopologyNode(*, identifier: str, node_metadata_id: str, type: str, resource_type: str, identifier_metadata: IdentifierMetadata)[source]
Bases:
BaseModelInfrastructure resource node.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- identifier: str
- node_metadata_id: str
- type: str
- resource_type: str
- identifier_metadata: IdentifierMetadata
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TopologyEdge(*, source: str, target: str, source_node_metadata: str, target_node_metadata: str)[source]
Bases:
BaseModelRelationship between topology nodes.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- source: str
- target: str
- source_node_metadata: str
- target_node_metadata: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.Topology(*, nodes: ~typing.List[~devopsagent_api.models.TopologyNode] = <factory>, edges: ~typing.List[~devopsagent_api.models.TopologyEdge] = <factory>)[source]
Bases:
BaseModelTopology data structure.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- nodes: List[TopologyNode]
- edges: List[TopologyEdge]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TopologyData(*, topology: Topology)[source]
Bases:
BaseModelTopology query response data.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TopologyQueryRequest(*, agent_space_id: str, query: str, variables: Dict[str, Any] | None = None)[source]
Bases:
BaseModelRequest for topology query.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- query: str
- variables: Dict[str, Any] | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.TopologyQueryResponse(*, data: TopologyData)[source]
Bases:
BaseModelResponse from topology query.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- data: TopologyData
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportLevel(*, code: str, name: str)[source]
Bases:
BaseModelAWS Support level information.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- code: str
- name: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportLevelRequest(*, agent_space_id: str, task_id: str)[source]
Bases:
BaseModelRequest for support level.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportLevelResponse(*, support_level: SupportLevel)[source]
Bases:
BaseModelResponse with support level.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- support_level: SupportLevel
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportChatRequest(*, agent_space_id: str, task_id: str, client_token: str | None = None)[source]
Bases:
BaseModelRequest to create support chat.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str
- client_token: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportChatResponse(*, chat_id: str, status: str, created_at: str)[source]
Bases:
BaseModelResponse from support chat creation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- chat_id: str
- status: str
- created_at: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportChatEndRequest(*, agent_space_id: str, task_id: str, client_token: str | None = None, reason: str | None = None, requester: str | None = None)[source]
Bases:
BaseModelRequest to end support chat.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- agent_space_id: str
- task_id: str
- client_token: str | None
- reason: str | None
- requester: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.SupportChatEndResponse(*, status: str, ended_at: str)[source]
Bases:
BaseModelResponse from support chat ending.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- status: str
- ended_at: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class devopsagent_api.models.ErrorResponse(*, error: str, message: str, status_code: int, request_id: str | None = None)[source]
Bases:
BaseModelAPI error response.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- error: str
- message: str
- status_code: int
- request_id: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- devopsagent_api.models.parse_journal_content(content: str) MessageContent | PlanContent | ActivityContent | ObservationContent | SymptomContent | FindingContent | InvestigationSummaryContent | Dict[str, Any][source]
Parse JSON-encoded journal record content.
- Parameters:
content – JSON string from journal record
- Returns:
Parsed content object or dict if unknown type
Model Hierarchy
The models are organized hierarchically:
Base Models: Common fields and validation
Request Models: Data sent to the API
Response Models: Data received from the API
Enum Models: Fixed choice values
Common Patterns
Optional Fields
Many models use optional fields to handle varying API responses:
from typing import Optional
from pydantic import BaseModel
class Task(BaseModel):
id: str
title: str
status: str
description: Optional[str] = None # Optional field
Enum Validation
Enums ensure only valid values are accepted:
from enum import Enum
class TaskStatus(str, Enum):
PENDING = "PENDING"
IN_PROGRESS = "IN_PROGRESS"
COMPLETED = "COMPLETED"
FAILED = "FAILED"
Nested Models
Complex responses use nested models:
class TaskResponse(BaseModel):
task: Task
metadata: TaskMetadata
Validation Rules
Models include validation rules for data integrity:
Field Types: Strict type checking
Required Fields: Mandatory vs optional fields
Value Constraints: Min/max values, patterns
Custom Validators: Business logic validation
Usage Examples
Creating Model Instances
from devopsagent_api.models import Task
task = Task(
id="task-123",
title="Deploy application",
status="IN_PROGRESS",
description="Deploy to production"
)
Parsing API Responses
import json
from devopsagent_api.models import TaskResponse
# Parse JSON response
response_data = json.loads(api_response)
task_response = TaskResponse(**response_data)
Validation Errors
Models raise validation errors for invalid data:
from pydantic import ValidationError
try:
task = Task(id="123") # Missing required fields
except ValidationError as e:
print(f"Validation error: {e}")
Model Serialization
Models can be easily serialized to JSON:
# Convert to dict
task_dict = task.dict()
# Convert to JSON
task_json = task.json()
# Exclude None values
task_dict = task.dict(exclude_none=True)
Type Hints
All models include comprehensive type hints for IDE support:
def process_task(task: Task) -> TaskResponse:
# IDE will provide autocomplete and type checking
return TaskResponse(task=task, metadata=TaskMetadata())
Inheritance
Models use inheritance for code reuse:
class BaseModel(BaseModel):
id: str
created_at: datetime
updated_at: Optional[datetime] = None
class Task(BaseModel):
title: str
status: TaskStatus
# Inherits id, created_at, updated_at from BaseModel
Custom Validators
Some models include custom validation logic:
from pydantic import validator
class Task(BaseModel):
title: str
status: TaskStatus
@validator('title')
def title_must_not_be_empty(cls, v):
if not v.strip():
raise ValueError('Title cannot be empty')
return v
Best Practices
Use Type Hints
# Good
def create_task(title: str, status: TaskStatus) -> Task:
return Task(title=title, status=status)
# Avoid
def create_task(title, status):
return Task(title=title, status=status)
Handle Validation Errors
try:
task = Task(**api_data)
except ValidationError as e:
logger.error(f"Invalid task data: {e}")
raise
Use Model Methods
# Use model methods for serialization
task_json = task.json(indent=2)
# Use dict() for programmatic access
if task.status == TaskStatus.COMPLETED:
print(f"Task {task.id} is complete")