tcex 5.0.0.dev3__py3-none-any.whl → 5.0.0.dev4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. tcex/__metadata__.py +1 -1
  2. tcex/api/tc/ti_transform/ti_transform.py +8 -8
  3. tcex/api/tc/ti_transform/transform_abc.py +6 -5
  4. tcex/api/tc/util/threat_intel_util.py +2 -2
  5. tcex/api/tc/v2/batch/batch_cleaner.py +2 -2
  6. tcex/api/tc/v3/_gen/_gen_abc.py +2 -2
  7. tcex/api/tc/v3/_gen/_gen_model_abc.py +9 -11
  8. tcex/api/tc/v3/_gen/_gen_object_abc.py +15 -14
  9. tcex/api/tc/v3/_gen/model/_filter_model.py +1 -1
  10. tcex/api/tc/v3/artifact_types/artifact_type.py +1 -1
  11. tcex/api/tc/v3/artifact_types/artifact_type_model.py +1 -1
  12. tcex/api/tc/v3/artifacts/artifact.py +1 -1
  13. tcex/api/tc/v3/artifacts/artifact_model.py +7 -7
  14. tcex/api/tc/v3/attribute_types/attribute_type.py +1 -1
  15. tcex/api/tc/v3/attribute_types/attribute_type_model.py +1 -1
  16. tcex/api/tc/v3/case_attributes/case_attribute.py +1 -1
  17. tcex/api/tc/v3/case_attributes/case_attribute_model.py +3 -3
  18. tcex/api/tc/v3/cases/case.py +2 -2
  19. tcex/api/tc/v3/cases/case_filter.py +1 -1
  20. tcex/api/tc/v3/cases/case_model.py +14 -14
  21. tcex/api/tc/v3/file_occurrences/file_occurrence_model.py +1 -1
  22. tcex/api/tc/v3/group_attributes/group_attribute.py +1 -1
  23. tcex/api/tc/v3/group_attributes/group_attribute_model.py +4 -4
  24. tcex/api/tc/v3/groups/group.py +2 -2
  25. tcex/api/tc/v3/groups/group_filter.py +36 -0
  26. tcex/api/tc/v3/groups/group_model.py +25 -20
  27. tcex/api/tc/v3/indicator_attributes/indicator_attribute.py +1 -1
  28. tcex/api/tc/v3/indicator_attributes/indicator_attribute_model.py +4 -4
  29. tcex/api/tc/v3/indicators/indicator.py +2 -2
  30. tcex/api/tc/v3/indicators/indicator_filter.py +16 -0
  31. tcex/api/tc/v3/indicators/indicator_model.py +10 -10
  32. tcex/api/tc/v3/intel_requirements/categories/category.py +1 -1
  33. tcex/api/tc/v3/intel_requirements/categories/category_model.py +1 -1
  34. tcex/api/tc/v3/intel_requirements/intel_req_type_model.py +1 -1
  35. tcex/api/tc/v3/intel_requirements/intel_requirement.py +3 -3
  36. tcex/api/tc/v3/intel_requirements/intel_requirement_model.py +10 -10
  37. tcex/api/tc/v3/intel_requirements/results/result.py +1 -1
  38. tcex/api/tc/v3/intel_requirements/results/result_model.py +1 -1
  39. tcex/api/tc/v3/intel_requirements/subtypes/subtype.py +1 -1
  40. tcex/api/tc/v3/intel_requirements/subtypes/subtype_model.py +1 -1
  41. tcex/api/tc/v3/notes/note.py +1 -1
  42. tcex/api/tc/v3/notes/note_model.py +5 -5
  43. tcex/api/tc/v3/object_abc.py +4 -3
  44. tcex/api/tc/v3/object_collection_abc.py +1 -1
  45. tcex/api/tc/v3/security/assignee_model.py +1 -1
  46. tcex/api/tc/v3/security/assignee_user_group_model.py +1 -1
  47. tcex/api/tc/v3/security/assignee_user_model.py +1 -1
  48. tcex/api/tc/v3/security/exclusion_lists/exclusion_list.py +1 -1
  49. tcex/api/tc/v3/security/exclusion_lists/exclusion_list_model.py +1 -1
  50. tcex/api/tc/v3/security/owner_roles/owner_role.py +1 -1
  51. tcex/api/tc/v3/security/owner_roles/owner_role_model.py +1 -1
  52. tcex/api/tc/v3/security/owners/owner.py +1 -1
  53. tcex/api/tc/v3/security/owners/owner_model.py +1 -1
  54. tcex/api/tc/v3/security/system_roles/system_role.py +1 -1
  55. tcex/api/tc/v3/security/system_roles/system_role_model.py +1 -1
  56. tcex/api/tc/v3/security/task_assignee_model.py +1 -1
  57. tcex/api/tc/v3/security/user_groups/user_group.py +1 -1
  58. tcex/api/tc/v3/security/user_groups/user_group_model.py +2 -2
  59. tcex/api/tc/v3/security/users/user.py +1 -1
  60. tcex/api/tc/v3/security/users/user_model.py +1 -1
  61. tcex/api/tc/v3/security_labels/security_label.py +1 -1
  62. tcex/api/tc/v3/security_labels/security_label_model.py +1 -1
  63. tcex/api/tc/v3/tags/tag.py +1 -1
  64. tcex/api/tc/v3/tags/tag_model.py +5 -5
  65. tcex/api/tc/v3/tasks/task.py +1 -1
  66. tcex/api/tc/v3/tasks/task_model.py +5 -5
  67. tcex/api/tc/v3/v3_model_abc.py +16 -16
  68. tcex/api/tc/v3/victim_assets/victim_asset.py +1 -1
  69. tcex/api/tc/v3/victim_assets/victim_asset_model.py +2 -2
  70. tcex/api/tc/v3/victim_attributes/victim_attribute.py +1 -1
  71. tcex/api/tc/v3/victim_attributes/victim_attribute_model.py +3 -3
  72. tcex/api/tc/v3/victims/victim.py +1 -1
  73. tcex/api/tc/v3/victims/victim_model.py +6 -6
  74. tcex/api/tc/v3/workflow_events/workflow_event.py +1 -1
  75. tcex/api/tc/v3/workflow_events/workflow_event_model.py +4 -4
  76. tcex/api/tc/v3/workflow_templates/workflow_template.py +1 -1
  77. tcex/api/tc/v3/workflow_templates/workflow_template_model.py +3 -3
  78. tcex/app/config/app_spec_yml.py +22 -1
  79. tcex/app/config/install_json.py +34 -0
  80. tcex/app/config/layout_json.py +17 -1
  81. tcex/app/config/model/app_spec_yml_model.py +2 -2
  82. tcex/app/config/model/install_json_model.py +4 -4
  83. tcex/app/config/model/job_json_model.py +8 -4
  84. tcex/app/config/model/layout_json_model.py +1 -1
  85. tcex/app/config/permutation.py +8 -8
  86. tcex/app/config/tcex_json.py +16 -0
  87. tcex/app/decorator/benchmark.py +6 -3
  88. tcex/app/decorator/debug.py +1 -1
  89. tcex/app/decorator/fail_on_output.py +1 -1
  90. tcex/app/decorator/on_exception.py +1 -1
  91. tcex/app/decorator/on_success.py +1 -1
  92. tcex/app/decorator/output.py +1 -1
  93. tcex/app/key_value_store/key_value_redis.py +3 -3
  94. tcex/app/playbook/advanced_request.py +1 -1
  95. tcex/app/playbook/playbook_create.py +12 -13
  96. tcex/app/playbook/playbook_read.py +2 -2
  97. tcex/app/service/common_service_trigger.py +2 -2
  98. tcex/app/service/mqtt_message_broker.py +6 -2
  99. tcex/app/service/webhook_trigger_service.py +1 -1
  100. tcex/app/token/token.py +1 -1
  101. tcex/input/field_type/edit_choice.py +4 -1
  102. tcex/input/field_type/key_value.py +3 -15
  103. tcex/input/field_type/validator.py +9 -8
  104. tcex/pleb/cached_property.py +3 -2
  105. tcex/pleb/cached_property_filesystem.py +3 -3
  106. tcex/pleb/jmespath_custom.py +1 -1
  107. tcex/pleb/jmespath_functions_array_mixin.py +9 -9
  108. tcex/pleb/jmespath_functions_base.py +6 -6
  109. tcex/pleb/jmespath_functions_math_mixin.py +5 -4
  110. tcex/pleb/jmespath_functions_string_mixin.py +10 -10
  111. tcex/pleb/proxies.py +2 -2
  112. tcex/registry.py +5 -2
  113. tcex/requests_external/external_session.py +6 -5
  114. tcex/requests_tc/auth/hmac_auth.py +6 -1
  115. tcex/requests_tc/auth/tc_auth.py +2 -2
  116. tcex/requests_tc/auth/token_auth.py +6 -1
  117. tcex/requests_tc/requests_tc.py +5 -3
  118. tcex/requests_tc/tc_session.py +13 -13
  119. tcex/util/code_operation.py +2 -1
  120. tcex/util/datetime_operation.py +2 -1
  121. tcex/util/requests_to_curl.py +6 -4
  122. {tcex-5.0.0.dev3.dist-info → tcex-5.0.0.dev4.dist-info}/METADATA +16 -16
  123. {tcex-5.0.0.dev3.dist-info → tcex-5.0.0.dev4.dist-info}/RECORD +126 -126
  124. {tcex-5.0.0.dev3.dist-info → tcex-5.0.0.dev4.dist-info}/WHEEL +0 -0
  125. {tcex-5.0.0.dev3.dist-info → tcex-5.0.0.dev4.dist-info}/licenses/LICENSE +0 -0
  126. {tcex-5.0.0.dev3.dist-info → tcex-5.0.0.dev4.dist-info}/top_level.txt +0 -0
tcex/__metadata__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """TcEx Framework Module"""
2
2
 
3
3
  __license__ = 'Apache-2.0'
4
- __version__ = '5.0.0-dev3'
4
+ __version__ = '5.0.0-dev4'
@@ -154,7 +154,7 @@ class TiTransform(TransformABC):
154
154
  {'summary': summary, 'indicatorType': indicator_type}
155
155
  )
156
156
 
157
- def add_associated_group(self, ref_1: str):
157
+ def add_associated_group(self, group_xid: str):
158
158
  """Add an associated group.
159
159
 
160
160
  {
@@ -165,33 +165,33 @@ class TiTransform(TransformABC):
165
165
  if not self.separate_batch_associations:
166
166
  # process type specific data
167
167
  if isinstance(self.transform, GroupTransformModel):
168
- self.transformed_item.setdefault('associatedGroupXid', []).append(ref_1)
168
+ self.transformed_item.setdefault('associatedGroupXid', []).append(group_xid)
169
169
  elif isinstance(self.transform, IndicatorTransformModel):
170
- associated_group = {'groupXid': ref_1}
170
+ associated_group = {'groupXid': group_xid}
171
171
  self.transformed_item.setdefault('associatedGroups', []).append(associated_group)
172
172
  elif isinstance(self.transform, GroupTransformModel):
173
173
  self.transformed_item.setdefault('association', []).append(
174
174
  {
175
- 'ref_1': ref_1,
175
+ 'ref_1': group_xid,
176
176
  'ref_2': self.transformed_item['xid'],
177
177
  }
178
178
  )
179
179
  self.log.trace(
180
180
  'Added associated group with xid: %s to %s',
181
- ref_1,
181
+ group_xid,
182
182
  self.transformed_item['xid'],
183
183
  )
184
184
  elif isinstance(self.transform, IndicatorTransformModel):
185
185
  self.transformed_item.setdefault('association', []).append(
186
186
  {
187
- 'ref_1': ref_1,
187
+ 'ref_1': group_xid,
188
188
  'ref_2': self.transformed_item['summary'],
189
189
  'type_2': self.transformed_item['type'],
190
190
  }
191
191
  )
192
192
  self.log.trace(
193
193
  'Added associated group with xid: %s to %s',
194
- ref_1,
194
+ group_xid,
195
195
  self.transformed_item['summary'],
196
196
  )
197
197
 
@@ -264,7 +264,7 @@ class TiTransform(TransformABC):
264
264
  """
265
265
  self.adhoc_indicators.append(indicator_data)
266
266
 
267
- def add_metadata(self, key: str, value: str):
267
+ def add_metadata(self, key: str, value: str | int):
268
268
  """Add name to the transformed item."""
269
269
  if all([key, value]):
270
270
  self.transformed_item[key] = value
@@ -320,7 +320,7 @@ class TransformABC(ABC):
320
320
  bool,
321
321
  [v for v in self._process_metadata_transform_model(association.value) if v],
322
322
  ):
323
- self.add_associated_group(value) # type: ignore
323
+ self.add_associated_group(value)
324
324
  except Exception as ex:
325
325
  ex_msg = f'Associated Group [{i}]'
326
326
  raise TransformException(ex_msg, ex, context=association.model_dump()) from ex
@@ -602,7 +602,7 @@ class TransformABC(ABC):
602
602
  for i, tag in enumerate(tags or [], 1):
603
603
  try:
604
604
  for value in filter(bool, self._process_metadata_transform_model(tag.value)):
605
- self.add_tag(name=value) # type: ignore
605
+ self.add_tag(name=value)
606
606
  except Exception as ex:
607
607
  ex_msg = f'Tags [{i}]'
608
608
  raise TransformException(ex_msg, ex, context=tag.model_dump()) from ex
@@ -766,7 +766,7 @@ class TransformABC(ABC):
766
766
  if v_ is not None:
767
767
  _values.append(v_)
768
768
  value = _values
769
- # PYRIGHT-MISS - None check for value already performed above
769
+ # type-checker miss - None check for value already performed above
770
770
  elif callable(t.method) and value is not None:
771
771
  value = self._transform_value_callable(value, t.method, t.kwargs)
772
772
  elif callable(t.for_each):
@@ -775,8 +775,9 @@ class TransformABC(ABC):
775
775
  for v in self._always_array(value)
776
776
  ]
777
777
 
778
- # the output should be an array of strings or empty array
779
- _value = []
778
+ # the output should be an array of strings or empty array; the accumulator may transiently
779
+ # hold non-string members (e.g. a numeric metadata.default) before stringification.
780
+ _value: list[Any] = []
780
781
  for v in self._always_array(value):
781
782
  if v in [None, '']:
782
783
  if metadata.default is not None:
@@ -194,14 +194,14 @@ class ThreatIntelUtil:
194
194
  """
195
195
  return list(self.indicator_types_data.keys())
196
196
 
197
- def resolve_variables(self, inputs: list[str]) -> list[str]:
197
+ def resolve_variables(self, inputs: list[str]) -> list[str | None]:
198
198
  """Resolve all of the provided inputs if appropriate.
199
199
 
200
200
  Args:
201
201
  inputs: A list of strings to resolve if string matches a entry in the
202
202
  "resolved_variables" dict.
203
203
  """
204
- resolved_inputs = []
204
+ resolved_inputs: list[str | None] = []
205
205
  for input_ in inputs:
206
206
  # handle null inputs
207
207
  if not input_:
@@ -246,7 +246,7 @@ class BatchCleaner:
246
246
  if not config:
247
247
  return attribute_value
248
248
 
249
- max_length = config.get('maxSize')
249
+ max_length = config.get('max_size')
250
250
  if not max_length:
251
251
  return attribute_value
252
252
 
@@ -275,7 +275,7 @@ class BatchCleaner:
275
275
  item: A single group or indicator dictionary.
276
276
  attribute_types: Attribute type config dict keyed by name.
277
277
  deduplicate: Whether to remove duplicate attributes.
278
- truncate: Whether to truncate attributes based on maxSize.
278
+ truncate: Whether to truncate attributes based on max_size.
279
279
  truncated_types: A shared set tracking attribute types that have already
280
280
  been logged as truncated, to avoid duplicate log warnings. If None,
281
281
  warnings are logged for every truncation.
@@ -128,7 +128,7 @@ class GenerateABC(ABC): # noqa: B024
128
128
  _imports = [] # temp store for imports so they can be sorted
129
129
  for lib in libs:
130
130
  if isinstance(lib, dict):
131
- imports = ', '.join(sorted(lib.get('imports'))) # type: ignore
131
+ imports = ', '.join(sorted(lib.get('imports')))
132
132
  _imports.append(f'{indent}from {lib.get("module")} import {imports}{comment}')
133
133
  elif isinstance(lib, str):
134
134
  _imports.append(f'{indent}{lib}{comment}')
@@ -138,7 +138,7 @@ class GenerateABC(ABC): # noqa: B024
138
138
  _libs.append('') # add newline
139
139
 
140
140
  # This is the last part of the requirements generated.
141
- return '\n'.join(_libs) # type: ignore
141
+ return '\n'.join(_libs)
142
142
 
143
143
  def tap(self, type_: str):
144
144
  """Return the TcEx Api Path."""
@@ -2,6 +2,7 @@
2
2
 
3
3
  from abc import ABC
4
4
  from textwrap import TextWrapper
5
+ from typing import Any
5
6
 
6
7
  from tcex.api.tc.v3._gen._gen_abc import GenerateABC
7
8
  from tcex.util.string_operation import SnakeString
@@ -14,8 +15,9 @@ class GenerateModelABC(GenerateABC, ABC):
14
15
  """Initialize instance properties."""
15
16
  super().__init__(type_)
16
17
 
17
- # properties
18
- self.requirements = {
18
+ # properties; buckets hold heterogeneous entries (plain import strings vs. module/imports
19
+ # dicts), so type the values as list[Any] for the dynamically-built accumulator.
20
+ self.requirements: dict[str, list[Any]] = {
19
21
  'standard library': ['from __future__ import annotations'],
20
22
  'third-party': [
21
23
  {'module': 'pydantic', 'imports': ['BaseModel', 'Field']},
@@ -26,7 +28,7 @@ class GenerateModelABC(GenerateABC, ABC):
26
28
  ],
27
29
  'first-party-forward-reference': [],
28
30
  }
29
- self.validators = {}
31
+ self.validators: dict[str, dict[str, Any]] = {}
30
32
 
31
33
  def _add_module_class(self, from_: str, module: str, class_: str):
32
34
  """Add pydantic validator only when required."""
@@ -62,14 +64,14 @@ class GenerateModelABC(GenerateABC, ABC):
62
64
  f'{self.i1}@classmethod',
63
65
  f'{self.i1}def _validate_{type_.snake_case()}(cls, v):',
64
66
  f'{self.i2}if not v:',
65
- f'{self.i3}return {typing_type}() # type: ignore',
67
+ f'{self.i3}return {typing_type}()',
66
68
  f'{self.i2}return v',
67
69
  '',
68
70
  ]
69
71
  )
70
72
 
71
73
  # TODO: [low] bsummers - research combining this method with parent method
72
- def _format_description(self, description: str, length: int) -> str:
74
+ def _format_model_description(self, description: str, length: int) -> str:
73
75
  """Format description for field."""
74
76
  # fix descriptions coming from core API endpoint
75
77
  if description[-1] not in ('.', '?', '!'):
@@ -311,12 +313,8 @@ class GenerateModelABC(GenerateABC, ABC):
311
313
  self.validators[prop.type]['typing_type'] = prop.extra.typing_type
312
314
 
313
315
  # update model
314
- comment = ''
315
- if prop.extra.alias.snake_case() in ['id']:
316
- comment = ' # type: ignore'
317
316
  _model.append(
318
- f'{self.i1}{prop.extra.alias.snake_case()}: '
319
- f'{prop.extra.typing_type} = Field({comment}'
317
+ f'{self.i1}{prop.extra.alias.snake_case()}: {prop.extra.typing_type} = Field('
320
318
  )
321
319
  _model.append(f'{self.i2}default=None,') # the default value
322
320
 
@@ -326,7 +324,7 @@ class GenerateModelABC(GenerateABC, ABC):
326
324
 
327
325
  # description - Use the TC provided description
328
326
  # if available, otherwise use a default format.
329
- field_description = self._format_description(
327
+ field_description = self._format_model_description(
330
328
  (
331
329
  prop.description
332
330
  or (
@@ -1,6 +1,7 @@
1
1
  """TcEx Framework Module"""
2
2
 
3
3
  from abc import ABC
4
+ from typing import Any
4
5
 
5
6
  from tcex.api.tc.v3._gen._gen_abc import GenerateABC
6
7
  from tcex.api.tc.v3._gen._gen_args_abc import GenerateArgsABC
@@ -18,8 +19,9 @@ class GenerateObjectABC(GenerateABC, ABC):
18
19
  """Initialize instance properties."""
19
20
  super().__init__(type_)
20
21
 
21
- # properties
22
- self.requirements = {
22
+ # properties; buckets hold heterogeneous entries (plain import strings vs. module/imports
23
+ # dicts), so type the values as list[Any] for the dynamically-built accumulator.
24
+ self.requirements: dict[str, list[Any]] = {
23
25
  'standard library': [],
24
26
  'third-party': [],
25
27
  'first-party': [
@@ -143,11 +145,7 @@ class GenerateObjectABC(GenerateABC, ABC):
143
145
  f'Iterator[{self.type_.singular().pascal_case()}]:'
144
146
  ),
145
147
  f'{self.i2}"""Return CM objects."""',
146
- (
147
- f'{self.i2}return self.iterate(base_class='
148
- f'{self.type_.singular().pascal_case()})'
149
- ' # type: ignore'
150
- ),
148
+ (f'{self.i2}return self.iterate(base_class={self.type_.singular().pascal_case()})'),
151
149
  '',
152
150
  '',
153
151
  ]
@@ -510,17 +508,20 @@ class GenerateObjectABC(GenerateABC, ABC):
510
508
  f'{self.i2}if not isinstance(data, list):',
511
509
  f'{self.i3}data = [data]',
512
510
  '',
513
- f'{self.i2}if all(isinstance(item, ({model_class} | ObjectABC)) for item in data):'
511
+ # the runtime all(isinstance(...)) guards establish the element type, but ty cannot
512
+ # narrow through them; the targeted ignores below reflect correct-but-uninferable code.
513
+ f'{self.i2}if all(isinstance(item, ({model_class} | ObjectABC)) for item in data):',
514
514
  f'{self.i3}transformed_data = data',
515
- f'{self.i2}elif all(isinstance(item, dict) for item in data):'
516
- f'{self.i3}transformed_data = [{model_class}(**d) for d in data]',
515
+ f'{self.i2}elif all(isinstance(item, dict) for item in data):',
516
+ f'{self.i3}transformed_data = '
517
+ f'[{model_class}(**d) for d in data] # ty: ignore[invalid-argument-type]',
517
518
  f'{self.i2}else:',
518
519
  f'{self.i3}ex_msg = "Invalid data to replace_{model_type.singular()}"',
519
520
  f'{self.i3}raise ValueError(ex_msg)',
520
521
  '',
521
522
  '',
522
523
  f'{self.i2}for item in transformed_data:',
523
- f'{self.i3}item._staged = True # noqa: SLF001',
524
+ f'{self.i3}item._staged = True # ty: ignore[unresolved-attribute] # noqa: SLF001',
524
525
  '',
525
526
  f'{self.i2}self.model.{model_reference} = transformed_data # type: ignore',
526
527
  '',
@@ -707,7 +708,7 @@ class GenerateObjectABC(GenerateABC, ABC):
707
708
  # f'{self.i2}self.model.assignee._staged = True
708
709
  # f'{self.i2}self.model.assignee.type = type',
709
710
  # pylance shows a warning on type here, but it in not handling inheritance properly.
710
- # f'{self.i2}self.model.assignee.data = data # type: ignore',
711
+ # (dead template line removed; it previously embedded a type-ignore directive)
711
712
  f'{self.i2}self.model.assignee.data._staged = True # type: ignore # noqa: SLF001',
712
713
  '',
713
714
  '',
@@ -813,7 +814,7 @@ class GenerateObjectABC(GenerateABC, ABC):
813
814
  _code.extend(
814
815
  [
815
816
  f'{self.i4}continue',
816
- f'{self.i3}yield {type_.singular()} # type: ignore',
817
+ f'{self.i3}yield {type_.singular()}',
817
818
  ]
818
819
  )
819
820
  else:
@@ -1156,6 +1157,6 @@ class GenerateObjectABC(GenerateABC, ABC):
1156
1157
  ):
1157
1158
  """Return the requirements code."""
1158
1159
  class_string = ', '.join(classes)
1159
- self.requirements[from_].append( # type: ignore
1160
+ self.requirements[from_].append(
1160
1161
  f'from {self.tap(type_)}.{type_.plural()}.{filename} import {class_string}'
1161
1162
  )
@@ -63,7 +63,7 @@ class FilterModel(
63
63
  """Return the extra model."""
64
64
  extra_data = self.__extra_data()
65
65
  # print(self.name, self.type, extra_data)
66
- return ExtraModel(**extra_data) # type: ignore
66
+ return ExtraModel(**extra_data)
67
67
 
68
68
  def __extra_data(self) -> dict:
69
69
  """Return the extra data."""
@@ -79,7 +79,7 @@ class ArtifactTypes(ObjectCollectionABC):
79
79
 
80
80
  def __iter__(self) -> Iterator[ArtifactType]:
81
81
  """Return CM objects."""
82
- return self.iterate(base_class=ArtifactType) # type: ignore
82
+ return self.iterate(base_class=ArtifactType)
83
83
 
84
84
  @property
85
85
  def _api_endpoint(self) -> str:
@@ -43,7 +43,7 @@ class ArtifactTypeModel(
43
43
  title='description',
44
44
  validate_default=True,
45
45
  )
46
- id: int | None = Field( # type: ignore
46
+ id: int | None = Field(
47
47
  default=None,
48
48
  description='The ID of the item.',
49
49
  title='id',
@@ -148,7 +148,7 @@ class Artifacts(ObjectCollectionABC):
148
148
 
149
149
  def __iter__(self) -> Iterator[Artifact]:
150
150
  """Return CM objects."""
151
- return self.iterate(base_class=Artifact) # type: ignore
151
+ return self.iterate(base_class=Artifact)
152
152
 
153
153
  @property
154
154
  def _api_endpoint(self) -> str:
@@ -132,7 +132,7 @@ class ArtifactModel(
132
132
  validate_default=True,
133
133
  json_schema_extra={'methods': ['POST']},
134
134
  )
135
- id: int | None = Field( # type: ignore
135
+ id: int | None = Field(
136
136
  default=None,
137
137
  description='The ID of the item.',
138
138
  title='id',
@@ -213,42 +213,42 @@ class ArtifactModel(
213
213
  @classmethod
214
214
  def _validate_artifact_type(cls, v):
215
215
  if not v:
216
- return ArtifactTypeModel() # type: ignore
216
+ return ArtifactTypeModel()
217
217
  return v
218
218
 
219
219
  @field_validator('parent_case', mode='before')
220
220
  @classmethod
221
221
  def _validate_case(cls, v):
222
222
  if not v:
223
- return CaseModel() # type: ignore
223
+ return CaseModel()
224
224
  return v
225
225
 
226
226
  @field_validator('associated_groups', mode='before')
227
227
  @classmethod
228
228
  def _validate_groups(cls, v):
229
229
  if not v:
230
- return GroupsModel() # type: ignore
230
+ return GroupsModel()
231
231
  return v
232
232
 
233
233
  @field_validator('associated_indicators', mode='before')
234
234
  @classmethod
235
235
  def _validate_indicators(cls, v):
236
236
  if not v:
237
- return IndicatorsModel() # type: ignore
237
+ return IndicatorsModel()
238
238
  return v
239
239
 
240
240
  @field_validator('notes', mode='before')
241
241
  @classmethod
242
242
  def _validate_notes(cls, v):
243
243
  if not v:
244
- return NotesModel() # type: ignore
244
+ return NotesModel()
245
245
  return v
246
246
 
247
247
  @field_validator('task', mode='before')
248
248
  @classmethod
249
249
  def _validate_task(cls, v):
250
250
  if not v:
251
- return TaskModel() # type: ignore
251
+ return TaskModel()
252
252
  return v
253
253
 
254
254
 
@@ -76,7 +76,7 @@ class AttributeTypes(ObjectCollectionABC):
76
76
 
77
77
  def __iter__(self) -> Iterator[AttributeType]:
78
78
  """Return CM objects."""
79
- return self.iterate(base_class=AttributeType) # type: ignore
79
+ return self.iterate(base_class=AttributeType)
80
80
 
81
81
  @property
82
82
  def _api_endpoint(self) -> str:
@@ -43,7 +43,7 @@ class AttributeTypeModel(
43
43
  validate_default=True,
44
44
  json_schema_extra={'methods': ['POST', 'PUT']},
45
45
  )
46
- id: int | None = Field( # type: ignore
46
+ id: int | None = Field(
47
47
  default=None,
48
48
  description='The ID of the item.',
49
49
  title='id',
@@ -100,7 +100,7 @@ class CaseAttributes(ObjectCollectionABC):
100
100
 
101
101
  def __iter__(self) -> Iterator[CaseAttribute]:
102
102
  """Return CM objects."""
103
- return self.iterate(base_class=CaseAttribute) # type: ignore
103
+ return self.iterate(base_class=CaseAttribute)
104
104
 
105
105
  @property
106
106
  def _api_endpoint(self) -> str:
@@ -55,7 +55,7 @@ class CaseAttributeModel(
55
55
  validate_default=True,
56
56
  json_schema_extra={'methods': ['POST', 'PUT']},
57
57
  )
58
- id: int | None = Field( # type: ignore
58
+ id: int | None = Field(
59
59
  default=None,
60
60
  description='The ID of the item.',
61
61
  title='id',
@@ -118,14 +118,14 @@ class CaseAttributeModel(
118
118
  @classmethod
119
119
  def _validate_security_labels(cls, v):
120
120
  if not v:
121
- return SecurityLabelsModel() # type: ignore
121
+ return SecurityLabelsModel()
122
122
  return v
123
123
 
124
124
  @field_validator('created_by', mode='before')
125
125
  @classmethod
126
126
  def _validate_user(cls, v):
127
127
  if not v:
128
- return UserModel() # type: ignore
128
+ return UserModel()
129
129
  return v
130
130
 
131
131
 
@@ -88,7 +88,7 @@ class Case(ObjectABC):
88
88
  for case in self._iterate_over_sublist(Cases): # type: ignore
89
89
  if case.model.id == self.model.id:
90
90
  continue
91
- yield case # type: ignore
91
+ yield case
92
92
 
93
93
  @property
94
94
  def associated_groups(self) -> Generator['Group', None, None]:
@@ -312,7 +312,7 @@ class Cases(ObjectCollectionABC):
312
312
 
313
313
  def __iter__(self) -> Iterator[Case]:
314
314
  """Return CM objects."""
315
- return self.iterate(base_class=Case) # type: ignore
315
+ return self.iterate(base_class=Case)
316
316
 
317
317
  @property
318
318
  def _api_endpoint(self) -> str:
@@ -435,7 +435,7 @@ class CaseFilter(FilterABC):
435
435
  self._tql.add_filter('lastUpdated', operator, last_updated, TqlType.STRING)
436
436
 
437
437
  def missing_artifact_count(self, operator: Enum, missing_artifact_count: int | list):
438
- """Filter Missing Artifact Count For Tasks based on **missingArtifactCount** keyword.
438
+ """Filter Missing Artifact Count based on **missingArtifactCount** keyword.
439
439
 
440
440
  Args:
441
441
  operator: The operator enum for the filter.
@@ -160,7 +160,7 @@ class CaseModel(
160
160
  title='detectionOverdue',
161
161
  validate_default=True,
162
162
  )
163
- id: int | None = Field( # type: ignore
163
+ id: int | None = Field(
164
164
  default=None,
165
165
  description='The ID of the item.',
166
166
  title='id',
@@ -313,63 +313,63 @@ class CaseModel(
313
313
  @classmethod
314
314
  def _validate_artifacts(cls, v):
315
315
  if not v:
316
- return ArtifactsModel() # type: ignore
316
+ return ArtifactsModel()
317
317
  return v
318
318
 
319
319
  @field_validator('assignee', mode='before')
320
320
  @classmethod
321
321
  def _validate_assignee(cls, v):
322
322
  if not v:
323
- return AssigneeModel() # type: ignore
323
+ return AssigneeModel()
324
324
  return v
325
325
 
326
326
  @field_validator('attributes', mode='before')
327
327
  @classmethod
328
328
  def _validate_case_attributes(cls, v):
329
329
  if not v:
330
- return CaseAttributesModel() # type: ignore
330
+ return CaseAttributesModel()
331
331
  return v
332
332
 
333
333
  @field_validator('associated_cases', 'related', mode='before')
334
334
  @classmethod
335
335
  def _validate_cases(cls, v):
336
336
  if not v:
337
- return CasesModel() # type: ignore
337
+ return CasesModel()
338
338
  return v
339
339
 
340
340
  @field_validator('associated_groups', mode='before')
341
341
  @classmethod
342
342
  def _validate_groups(cls, v):
343
343
  if not v:
344
- return GroupsModel() # type: ignore
344
+ return GroupsModel()
345
345
  return v
346
346
 
347
347
  @field_validator('associated_indicators', mode='before')
348
348
  @classmethod
349
349
  def _validate_indicators(cls, v):
350
350
  if not v:
351
- return IndicatorsModel() # type: ignore
351
+ return IndicatorsModel()
352
352
  return v
353
353
 
354
354
  @field_validator('notes', mode='before')
355
355
  @classmethod
356
356
  def _validate_notes(cls, v):
357
357
  if not v:
358
- return NotesModel() # type: ignore
358
+ return NotesModel()
359
359
  return v
360
360
 
361
361
  @field_validator('tags', mode='before')
362
362
  @classmethod
363
363
  def _validate_tags(cls, v):
364
364
  if not v:
365
- return TagsModel() # type: ignore
365
+ return TagsModel()
366
366
  return v
367
367
 
368
368
  @field_validator('tasks', mode='before')
369
369
  @classmethod
370
370
  def _validate_tasks(cls, v):
371
371
  if not v:
372
- return TasksModel() # type: ignore
372
+ return TasksModel()
373
373
  return v
374
374
 
375
375
  @field_validator(
@@ -383,28 +383,28 @@ class CaseModel(
383
383
  @classmethod
384
384
  def _validate_user(cls, v):
385
385
  if not v:
386
- return UserModel() # type: ignore
386
+ return UserModel()
387
387
  return v
388
388
 
389
389
  @field_validator('user_access', mode='before')
390
390
  @classmethod
391
391
  def _validate_users(cls, v):
392
392
  if not v:
393
- return UsersModel() # type: ignore
393
+ return UsersModel()
394
394
  return v
395
395
 
396
396
  @field_validator('workflow_events', mode='before')
397
397
  @classmethod
398
398
  def _validate_workflow_events(cls, v):
399
399
  if not v:
400
- return WorkflowEventsModel() # type: ignore
400
+ return WorkflowEventsModel()
401
401
  return v
402
402
 
403
403
  @field_validator('workflow_template', mode='before')
404
404
  @classmethod
405
405
  def _validate_workflow_template(cls, v):
406
406
  if not v:
407
- return WorkflowTemplateModel() # type: ignore
407
+ return WorkflowTemplateModel()
408
408
  return v
409
409
 
410
410
 
@@ -32,7 +32,7 @@ class FileOccurrenceModel(
32
32
  json_schema_extra={'methods': ['POST', 'PUT']},
33
33
  title='path',
34
34
  )
35
- id: int | None = Field( # type: ignore
35
+ id: int | None = Field(
36
36
  None,
37
37
  title='id',
38
38
  )
@@ -100,7 +100,7 @@ class GroupAttributes(ObjectCollectionABC):
100
100
 
101
101
  def __iter__(self) -> Iterator[GroupAttribute]:
102
102
  """Return CM objects."""
103
- return self.iterate(base_class=GroupAttribute) # type: ignore
103
+ return self.iterate(base_class=GroupAttribute)
104
104
 
105
105
  @property
106
106
  def _api_endpoint(self) -> str: