fmn.api.api_models module¶
- class fmn.api.api_models.Artifact(*, type: ArtifactType, name: str)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=ArtifactType, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- type: ArtifactType¶
- class fmn.api.api_models.ArtifactOptionsGroup(*, label: str, options: list[Option[Artifact]])[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'label': FieldInfo(annotation=str, required=True), 'options': FieldInfo(annotation=list[Option[Artifact]], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.ArtifactsFollowedTrackingRule(*, name: Literal['artifacts-followed'], params: list[dict[Literal['name', 'type'], str]])[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=Literal['artifacts-followed'], required=True), 'params': FieldInfo(annotation=list[dict[Literal['name', 'type'], str]], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.BaseModel[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class fmn.api.api_models.Destination(*, protocol: str, address: str)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'address': FieldInfo(annotation=str, required=True), 'protocol': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.Filters(*, applications: list[str] = [], severities: list[str] = [], topic: str | None = None, my_actions: bool = False)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'applications': FieldInfo(annotation=list[str], required=False, default=[]), 'my_actions': FieldInfo(annotation=bool, required=False, default=False), 'severities': FieldInfo(annotation=list[str], required=False, default=[]), 'topic': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.GenerationRule(*, id: int | None = None, destinations: list[Destination], filters: Filters)[source]¶
Bases:
BaseModel
- destinations: list[Destination]¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'destinations': FieldInfo(annotation=list[Destination], required=True), 'filters': FieldInfo(annotation=Filters, required=True), 'id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.ListParamTrackingRule(*, name: Literal['artifacts-owned', 'artifacts-group-owned', 'users-followed'], params: list[str])[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=Literal['artifacts-owned', 'artifacts-group-owned', 'users-followed'], required=True), 'params': FieldInfo(annotation=list[str], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.NewRule(*, name: str | None = None, disabled: bool = False, tracking_rule: ListParamTrackingRule | NoParamTrackingRule | ArtifactsFollowedTrackingRule, generation_rules: list[GenerationRule])[source]¶
Bases:
BaseModel
- generation_rules: list[GenerationRule]¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'disabled': FieldInfo(annotation=bool, required=False, default=False), 'generation_rules': FieldInfo(annotation=list[GenerationRule], required=True), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'tracking_rule': FieldInfo(annotation=Union[ListParamTrackingRule, NoParamTrackingRule, ArtifactsFollowedTrackingRule], required=True, discriminator='name')}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- tracking_rule: ListParamTrackingRule | NoParamTrackingRule | ArtifactsFollowedTrackingRule¶
- class fmn.api.api_models.NoParamTrackingRule(*, name: Literal['related-events'], params: str | None = None)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=Literal['related-events'], required=True), 'params': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.Option(*, label: str, value: T)[source]¶
-
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'label': FieldInfo(annotation=str, required=True), 'value': FieldInfo(annotation=~T, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- value: T¶
- class fmn.api.api_models.Rule(*, name: str | None = None, disabled: bool = False, tracking_rule: ListParamTrackingRule | NoParamTrackingRule | ArtifactsFollowedTrackingRule, generation_rules: list[GenerationRule], id: int, user: User, generated_last_week: int = 0)[source]¶
Bases:
NewRule
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'disabled': FieldInfo(annotation=bool, required=False, default=False), 'generated_last_week': FieldInfo(annotation=int, required=False, default=0), 'generation_rules': FieldInfo(annotation=list[GenerationRule], required=True), 'id': FieldInfo(annotation=int, required=True), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'tracking_rule': FieldInfo(annotation=Union[ListParamTrackingRule, NoParamTrackingRule, ArtifactsFollowedTrackingRule], required=True, discriminator='name'), 'user': FieldInfo(annotation=User, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class fmn.api.api_models.RulePatch(*, disabled: bool | None = None)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class fmn.api.api_models.User(*, id: int | None = None, name: str, is_admin: bool = False)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'is_admin': FieldInfo(annotation=bool, required=False, default=False), 'name': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.