legit-api-client 1.1.4516__py3-none-any.whl → 1.1.4623__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.

Potentially problematic release.


This version of legit-api-client might be problematic. Click here for more details.

@@ -659,6 +659,7 @@ class SDLCAssetsApi:
659
659
  self,
660
660
  show_only_integrated: Optional[StrictBool] = None,
661
661
  product_ids: Optional[List[StrictStr]] = None,
662
+ integration_ids: Optional[List[StrictStr]] = None,
662
663
  _request_timeout: Union[
663
664
  None,
664
665
  Annotated[StrictFloat, Field(gt=0)],
@@ -674,12 +675,14 @@ class SDLCAssetsApi:
674
675
  ) -> SdlcAssetGraphDto:
675
676
  """Get SDLC asset graph
676
677
 
677
- Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
678
+ Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. To view the SDLC graph in the context of specific integrations, use the `IntegrationIds` filter. The response will include only those specified integrations and their associated nodes and edges. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
678
679
 
679
680
  :param show_only_integrated:
680
681
  :type show_only_integrated: bool
681
682
  :param product_ids:
682
683
  :type product_ids: List[str]
684
+ :param integration_ids:
685
+ :type integration_ids: List[str]
683
686
  :param _request_timeout: timeout setting for this request. If one
684
687
  number provided, it will be total request
685
688
  timeout. It can also be a pair (tuple) of
@@ -705,6 +708,7 @@ class SDLCAssetsApi:
705
708
  _param = self._api_v10_sdlc_assets_graph_get_serialize(
706
709
  show_only_integrated=show_only_integrated,
707
710
  product_ids=product_ids,
711
+ integration_ids=integration_ids,
708
712
  _request_auth=_request_auth,
709
713
  _content_type=_content_type,
710
714
  _headers=_headers,
@@ -731,6 +735,7 @@ class SDLCAssetsApi:
731
735
  self,
732
736
  show_only_integrated: Optional[StrictBool] = None,
733
737
  product_ids: Optional[List[StrictStr]] = None,
738
+ integration_ids: Optional[List[StrictStr]] = None,
734
739
  _request_timeout: Union[
735
740
  None,
736
741
  Annotated[StrictFloat, Field(gt=0)],
@@ -746,12 +751,14 @@ class SDLCAssetsApi:
746
751
  ) -> ApiResponse[SdlcAssetGraphDto]:
747
752
  """Get SDLC asset graph
748
753
 
749
- Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
754
+ Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. To view the SDLC graph in the context of specific integrations, use the `IntegrationIds` filter. The response will include only those specified integrations and their associated nodes and edges. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
750
755
 
751
756
  :param show_only_integrated:
752
757
  :type show_only_integrated: bool
753
758
  :param product_ids:
754
759
  :type product_ids: List[str]
760
+ :param integration_ids:
761
+ :type integration_ids: List[str]
755
762
  :param _request_timeout: timeout setting for this request. If one
756
763
  number provided, it will be total request
757
764
  timeout. It can also be a pair (tuple) of
@@ -777,6 +784,7 @@ class SDLCAssetsApi:
777
784
  _param = self._api_v10_sdlc_assets_graph_get_serialize(
778
785
  show_only_integrated=show_only_integrated,
779
786
  product_ids=product_ids,
787
+ integration_ids=integration_ids,
780
788
  _request_auth=_request_auth,
781
789
  _content_type=_content_type,
782
790
  _headers=_headers,
@@ -803,6 +811,7 @@ class SDLCAssetsApi:
803
811
  self,
804
812
  show_only_integrated: Optional[StrictBool] = None,
805
813
  product_ids: Optional[List[StrictStr]] = None,
814
+ integration_ids: Optional[List[StrictStr]] = None,
806
815
  _request_timeout: Union[
807
816
  None,
808
817
  Annotated[StrictFloat, Field(gt=0)],
@@ -818,12 +827,14 @@ class SDLCAssetsApi:
818
827
  ) -> RESTResponseType:
819
828
  """Get SDLC asset graph
820
829
 
821
- Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
830
+ Each node in the graph is returned as an object in the `Assets` array. It is uniquely identified by the attributes `Id` and `Type`. The edges are represented by the `Links` array. The source of each link is `SourceId` and `SourceType`. The target of each link is `TargetId` and `TargetType`. The `IntegrationId` is not enough to identify a node, because it may apply to several nodes on the graph is some cases. For example is GitHub is used both as SCM and CI (GitHub Actions). To view the SDLC graph in the context of a Product Unit, use the `ProductIds` filter. The response will include only integrations associated with those Product Units - determined by the products’ assets (e.g., repositories, containers) - and will return the induced subgraphs for those integrations. This reveals the full SDLC graph a Product Unit is exposed to, including nodes not directly owned by its assets but connected through other assets within the same integration. To view the SDLC graph in the context of specific integrations, use the `IntegrationIds` filter. The response will include only those specified integrations and their associated nodes and edges. The Graph returned by this endpoint is more detailed than the Discovery Graph on the Legit Platform. When viewing the graph on the Legit Platform some nodes are aggregated into a single node (for example - all Amazon ECRs are displayed as a single node on the Legit Platform).
822
831
 
823
832
  :param show_only_integrated:
824
833
  :type show_only_integrated: bool
825
834
  :param product_ids:
826
835
  :type product_ids: List[str]
836
+ :param integration_ids:
837
+ :type integration_ids: List[str]
827
838
  :param _request_timeout: timeout setting for this request. If one
828
839
  number provided, it will be total request
829
840
  timeout. It can also be a pair (tuple) of
@@ -849,6 +860,7 @@ class SDLCAssetsApi:
849
860
  _param = self._api_v10_sdlc_assets_graph_get_serialize(
850
861
  show_only_integrated=show_only_integrated,
851
862
  product_ids=product_ids,
863
+ integration_ids=integration_ids,
852
864
  _request_auth=_request_auth,
853
865
  _content_type=_content_type,
854
866
  _headers=_headers,
@@ -870,6 +882,7 @@ class SDLCAssetsApi:
870
882
  self,
871
883
  show_only_integrated,
872
884
  product_ids,
885
+ integration_ids,
873
886
  _request_auth,
874
887
  _content_type,
875
888
  _headers,
@@ -880,6 +893,7 @@ class SDLCAssetsApi:
880
893
 
881
894
  _collection_formats: Dict[str, str] = {
882
895
  'productIds': 'multi',
896
+ 'integrationIds': 'multi',
883
897
  }
884
898
 
885
899
  _path_params: Dict[str, str] = {}
@@ -901,6 +915,10 @@ class SDLCAssetsApi:
901
915
 
902
916
  _query_params.append(('productIds', product_ids))
903
917
 
918
+ if integration_ids is not None:
919
+
920
+ _query_params.append(('integrationIds', integration_ids))
921
+
904
922
  # process the header parameters
905
923
  # process the form parameters
906
924
  # process the body parameter
@@ -91,7 +91,7 @@ class ApiClient:
91
91
  self.default_headers[header_name] = header_value
92
92
  self.cookie = cookie
93
93
  # Set default User-Agent.
94
- self.user_agent = 'OpenAPI-Generator/1.1.4516/python'
94
+ self.user_agent = 'OpenAPI-Generator/1.1.4623/python'
95
95
  self.client_side_validation = configuration.client_side_validation
96
96
 
97
97
  def __enter__(self):
@@ -312,7 +312,7 @@ class ApiClient:
312
312
  return_data = self.__deserialize_file(response_data)
313
313
  elif response_type is not None:
314
314
  match = None
315
- content_type = response_data.getheader('content-type')
315
+ content_type = response_data.headers.get('content-type')
316
316
  if content_type is not None:
317
317
  match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
318
318
  encoding = match.group(1) if match else "utf-8"
@@ -329,7 +329,7 @@ class ApiClient:
329
329
  return ApiResponse(
330
330
  status_code = response_data.status,
331
331
  data = return_data,
332
- headers = response_data.getheaders(),
332
+ headers = response_data.headers,
333
333
  raw_data = response_data.data
334
334
  )
335
335
 
@@ -701,7 +701,7 @@ class ApiClient:
701
701
  os.close(fd)
702
702
  os.remove(path)
703
703
 
704
- content_disposition = response.getheader("Content-Disposition")
704
+ content_disposition = response.headers.get("Content-Disposition")
705
705
  if content_disposition:
706
706
  m = re.search(
707
707
  r'filename=[\'"]?([^\'"\s]+)[\'"]?',
@@ -164,7 +164,7 @@ class Configuration:
164
164
  :param ca_cert_data: verify the peer using concatenated CA certificate data
165
165
  in PEM (str) or DER (bytes) format.
166
166
  :param cert_file: the path to a client certificate file, for mTLS.
167
- :param key_file: the path to a client key file, for mTLS.
167
+ :param key_file: the path to a client key file, for mTLS.
168
168
 
169
169
  :Example:
170
170
  """
@@ -486,6 +486,7 @@ class Configuration:
486
486
  password = ""
487
487
  if self.password is not None:
488
488
  password = self.password
489
+
489
490
  return urllib3.util.make_headers(
490
491
  basic_auth=username + ':' + password
491
492
  ).get('authorization')
@@ -515,7 +516,7 @@ class Configuration:
515
516
  "OS: {env}\n"\
516
517
  "Python Version: {pyversion}\n"\
517
518
  "Version of the API: 1.0\n"\
518
- "SDK Package Version: 1.1.4516".\
519
+ "SDK Package Version: 1.1.4623".\
519
520
  format(env=sys.platform, pyversion=sys.version)
520
521
 
521
522
  def get_host_settings(self) -> List[HostSetting]:
@@ -563,6 +564,7 @@ class Configuration:
563
564
  variable_name, variable['default_value'])
564
565
 
565
566
  if 'enum_values' in variable \
567
+ and variable['enum_values'] \
566
568
  and used_value not in variable['enum_values']:
567
569
  raise ValueError(
568
570
  "The variable `{0}` in the host URL has invalid value "
@@ -128,7 +128,7 @@ class ApiException(OpenApiException):
128
128
  self.body = http_resp.data.decode('utf-8')
129
129
  except Exception:
130
130
  pass
131
- self.headers = http_resp.getheaders()
131
+ self.headers = http_resp.headers
132
132
 
133
133
  @classmethod
134
134
  def from_response(
@@ -169,8 +169,11 @@ class ApiException(OpenApiException):
169
169
  error_message += "HTTP response headers: {0}\n".format(
170
170
  self.headers)
171
171
 
172
- if self.data or self.body:
173
- error_message += "HTTP response body: {0}\n".format(self.data or self.body)
172
+ if self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.body)
174
+
175
+ if self.data:
176
+ error_message += "HTTP response data: {0}\n".format(self.data)
174
177
 
175
178
  return error_message
176
179
 
@@ -14,6 +14,7 @@
14
14
 
15
15
  # import models into model package
16
16
  from legit_api_client.models.add_issue_comment_dto import AddIssueCommentDto
17
+ from legit_api_client.models.ai_model_reputation_dto import AiModelReputationDto
17
18
  from legit_api_client.models.ai_secret_validation_result import AiSecretValidationResult
18
19
  from legit_api_client.models.amazon_ecr_key_integration_create_dto import AmazonEcrKeyIntegrationCreateDto
19
20
  from legit_api_client.models.amazon_ecr_key_integration_edit_dto import AmazonEcrKeyIntegrationEditDto
@@ -135,6 +136,7 @@ from legit_api_client.models.legit_score_requirement_group_type import LegitScor
135
136
  from legit_api_client.models.legit_score_requirement_type import LegitScoreRequirementType
136
137
  from legit_api_client.models.list_sort_direction import ListSortDirection
137
138
  from legit_api_client.models.manual_check_dto import ManualCheckDto
139
+ from legit_api_client.models.model_reputation import ModelReputation
138
140
  from legit_api_client.models.origin_type import OriginType
139
141
  from legit_api_client.models.package_source import PackageSource
140
142
  from legit_api_client.models.package_type import PackageType
@@ -162,6 +164,8 @@ from legit_api_client.models.product_unit_name_dto import ProductUnitNameDto
162
164
  from legit_api_client.models.product_unit_type import ProductUnitType
163
165
  from legit_api_client.models.programming_language import ProgrammingLanguage
164
166
  from legit_api_client.models.repositories_to_containers_operation_dto import RepositoriesToContainersOperationDto
167
+ from legit_api_client.models.repository_automatic_business_impact_factor import RepositoryAutomaticBusinessImpactFactor
168
+ from legit_api_client.models.repository_context_field_dto import RepositoryContextFieldDto
165
169
  from legit_api_client.models.repository_control_dto import RepositoryControlDto
166
170
  from legit_api_client.models.repository_directory import RepositoryDirectory
167
171
  from legit_api_client.models.repository_dto import RepositoryDto
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Inventory
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from legit_api_client.models.model_reputation import ModelReputation
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class AiModelReputationDto(BaseModel):
27
+ """
28
+ AiModelReputationDto
29
+ """ # noqa: E501
30
+ model_reputation: Optional[ModelReputation] = Field(default=None, alias="modelReputation")
31
+ reputation_breakdown: Optional[StrictStr] = Field(default=None, alias="reputationBreakdown")
32
+ name: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["modelReputation", "reputationBreakdown", "name"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of AiModelReputationDto from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # set to None if reputation_breakdown (nullable) is None
75
+ # and model_fields_set contains the field
76
+ if self.reputation_breakdown is None and "reputation_breakdown" in self.model_fields_set:
77
+ _dict['reputationBreakdown'] = None
78
+
79
+ # set to None if name (nullable) is None
80
+ # and model_fields_set contains the field
81
+ if self.name is None and "name" in self.model_fields_set:
82
+ _dict['name'] = None
83
+
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of AiModelReputationDto from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "modelReputation": obj.get("modelReputation"),
97
+ "reputationBreakdown": obj.get("reputationBreakdown"),
98
+ "name": obj.get("name")
99
+ })
100
+ return _obj
101
+
102
+
@@ -107,6 +107,8 @@ class ControlClassification(str, Enum):
107
107
  DYNATRACESCA = 'DynatraceSca'
108
108
  FORTIFYSCC = 'FortifyScc'
109
109
  BRIGHTSECURITY = 'BrightSecurity'
110
+ AWSSECURITYHUB = 'AwsSecurityHub'
111
+ CYTRIX = 'Cytrix'
110
112
 
111
113
  @classmethod
112
114
  def from_json(cls, json_str: str) -> Self:
@@ -67,6 +67,7 @@ class ControlSourceType(str, Enum):
67
67
  DYNATRACEINTEGRATION = 'DynatraceIntegration'
68
68
  FORTIFYSCCINTEGRATION = 'FortifySccIntegration'
69
69
  BRIGHTSECURITYINTEGRATION = 'BrightSecurityIntegration'
70
+ CYTRIXINTEGRATION = 'CytrixIntegration'
70
71
 
71
72
  @classmethod
72
73
  def from_json(cls, json_str: str) -> Self:
@@ -65,7 +65,8 @@ class CustomerFacingIssueDto(BaseModel):
65
65
  assigned_user_id: Optional[StrictStr] = Field(default=None, description="ID of the user assigned to handle this issue (if applicable)", alias="assignedUserId")
66
66
  sources: Optional[List[SourceDto]] = Field(default=None, description="The sources the issue originated from")
67
67
  product_units: Optional[List[ProductUnitIssueDto]] = Field(default=None, alias="productUnits")
68
- __properties: ClassVar[List[str]] = ["id", "title", "detectedAt", "lastClosedAt", "lastActionTime", "status", "issueType", "severity", "policySeverity", "closingReason", "closingLocation", "statusChangedNote", "snoozedType", "snoozedUntil", "score", "secretsDataDto", "dependencyVulnerabilityDataDto", "dastDataDto", "originId", "originType", "originLink", "actionId", "policyName", "assignedUserId", "sources", "productUnits"]
68
+ remediation_steps: Optional[List[StrictStr]] = Field(default=None, description="Remediation steps for resolving the issue", alias="remediationSteps")
69
+ __properties: ClassVar[List[str]] = ["id", "title", "detectedAt", "lastClosedAt", "lastActionTime", "status", "issueType", "severity", "policySeverity", "closingReason", "closingLocation", "statusChangedNote", "snoozedType", "snoozedUntil", "score", "secretsDataDto", "dependencyVulnerabilityDataDto", "dastDataDto", "originId", "originType", "originLink", "actionId", "policyName", "assignedUserId", "sources", "productUnits", "remediationSteps"]
69
70
 
70
71
  model_config = ConfigDict(
71
72
  populate_by_name=True,
@@ -229,6 +230,11 @@ class CustomerFacingIssueDto(BaseModel):
229
230
  if self.product_units is None and "product_units" in self.model_fields_set:
230
231
  _dict['productUnits'] = None
231
232
 
233
+ # set to None if remediation_steps (nullable) is None
234
+ # and model_fields_set contains the field
235
+ if self.remediation_steps is None and "remediation_steps" in self.model_fields_set:
236
+ _dict['remediationSteps'] = None
237
+
232
238
  return _dict
233
239
 
234
240
  @classmethod
@@ -266,7 +272,8 @@ class CustomerFacingIssueDto(BaseModel):
266
272
  "policyName": obj.get("policyName"),
267
273
  "assignedUserId": obj.get("assignedUserId"),
268
274
  "sources": [SourceDto.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None,
269
- "productUnits": [ProductUnitIssueDto.from_dict(_item) for _item in obj["productUnits"]] if obj.get("productUnits") is not None else None
275
+ "productUnits": [ProductUnitIssueDto.from_dict(_item) for _item in obj["productUnits"]] if obj.get("productUnits") is not None else None,
276
+ "remediationSteps": obj.get("remediationSteps")
270
277
  })
271
278
  return _obj
272
279
 
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Inventory
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class ModelReputation(str, Enum):
22
+ """
23
+ ModelReputation
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ NONE = 'None'
30
+ LOW = 'Low'
31
+ MEDIUM = 'Medium'
32
+ HIGH = 'High'
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of ModelReputation from a JSON string"""
37
+ return cls(json.loads(json_str))
38
+
39
+
@@ -46,6 +46,10 @@ class ProductConnectionType(str, Enum):
46
46
  AGGREGATEDHOST = 'AggregatedHost'
47
47
  CLOUDCOMPUTERESOURCEQUERY = 'CloudComputeResourceQuery'
48
48
  CLOUDCOMPUTERESOURCE = 'CloudComputeResource'
49
+ CIWORKFLOWS = 'CiWorkflows'
50
+ CIWORKFLOWSQUERY = 'CiWorkflowsQuery'
51
+ CONTAINERIMAGE = 'ContainerImage'
52
+ HOST = 'Host'
49
53
  NESTEDPRODUCTREPOSITORY = 'NestedProductRepository'
50
54
 
51
55
  @classmethod
@@ -0,0 +1,43 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Inventory
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class RepositoryAutomaticBusinessImpactFactor(str, Enum):
22
+ """
23
+ RepositoryAutomaticBusinessImpactFactor
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ UNKNOWN = 'Unknown'
30
+ DEPLOYEDTOCLOUD = 'DeployedToCloud'
31
+ NETWORKFACING = 'NetworkFacing'
32
+ USINGAI = 'UsingAI'
33
+ ISOPENSOURCE = 'IsOpenSource'
34
+ HANDLINGSENSITIVEDATA = 'HandlingSensitiveData'
35
+ REVENUEGENERATING = 'RevenueGenerating'
36
+ EXPOSINGAPI = 'ExposingApi'
37
+
38
+ @classmethod
39
+ def from_json(cls, json_str: str) -> Self:
40
+ """Create an instance of RepositoryAutomaticBusinessImpactFactor from a JSON string"""
41
+ return cls(json.loads(json_str))
42
+
43
+
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Inventory
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from legit_api_client.models.repository_automatic_business_impact_factor import RepositoryAutomaticBusinessImpactFactor
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RepositoryContextFieldDto(BaseModel):
27
+ """
28
+ RepositoryContextFieldDto
29
+ """ # noqa: E501
30
+ factor: Optional[RepositoryAutomaticBusinessImpactFactor] = None
31
+ automatic_value: Optional[StrictBool] = Field(default=None, alias="automaticValue")
32
+ manual_value: Optional[StrictBool] = Field(default=None, alias="manualValue")
33
+ __properties: ClassVar[List[str]] = ["factor", "automaticValue", "manualValue"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of RepositoryContextFieldDto from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # set to None if automatic_value (nullable) is None
75
+ # and model_fields_set contains the field
76
+ if self.automatic_value is None and "automatic_value" in self.model_fields_set:
77
+ _dict['automaticValue'] = None
78
+
79
+ # set to None if manual_value (nullable) is None
80
+ # and model_fields_set contains the field
81
+ if self.manual_value is None and "manual_value" in self.model_fields_set:
82
+ _dict['manualValue'] = None
83
+
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of RepositoryContextFieldDto from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "factor": obj.get("factor"),
97
+ "automaticValue": obj.get("automaticValue"),
98
+ "manualValue": obj.get("manualValue")
99
+ })
100
+ return _obj
101
+
102
+
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, Stri
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from legit_api_client.models.collaborator_dto import CollaboratorDto
23
23
  from legit_api_client.models.product_unit_name_dto import ProductUnitNameDto
24
+ from legit_api_client.models.repository_context_field_dto import RepositoryContextFieldDto
24
25
  from legit_api_client.models.repository_group_dto import RepositoryGroupDto
25
26
  from legit_api_client.models.repository_visibility import RepositoryVisibility
26
27
  from legit_api_client.models.tag_dto import TagDto
@@ -40,12 +41,13 @@ class RepositoryDto(BaseModel):
40
41
  owner: Optional[CollaboratorDto] = None
41
42
  tags: Optional[List[TagDto]] = None
42
43
  product_units: Optional[List[ProductUnitNameDto]] = Field(default=None, alias="productUnits")
44
+ context_fields: Optional[List[RepositoryContextFieldDto]] = Field(default=None, alias="contextFields")
43
45
  issues_count: Optional[StrictInt] = Field(default=None, alias="issuesCount")
44
46
  lines_count: Optional[StrictInt] = Field(default=None, alias="linesCount")
45
47
  score: Optional[Union[StrictFloat, StrictInt]] = None
46
48
  score_out_of100: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="scoreOutOf100")
47
49
  group: Optional[RepositoryGroupDto] = None
48
- __properties: ClassVar[List[str]] = ["id", "name", "url", "visibility", "isActive", "isArchived", "owner", "tags", "productUnits", "issuesCount", "linesCount", "score", "scoreOutOf100", "group"]
50
+ __properties: ClassVar[List[str]] = ["id", "name", "url", "visibility", "isActive", "isArchived", "owner", "tags", "productUnits", "contextFields", "issuesCount", "linesCount", "score", "scoreOutOf100", "group"]
49
51
 
50
52
  model_config = ConfigDict(
51
53
  populate_by_name=True,
@@ -105,6 +107,13 @@ class RepositoryDto(BaseModel):
105
107
  if _item_product_units:
106
108
  _items.append(_item_product_units.to_dict())
107
109
  _dict['productUnits'] = _items
110
+ # override the default output from pydantic by calling `to_dict()` of each item in context_fields (list)
111
+ _items = []
112
+ if self.context_fields:
113
+ for _item_context_fields in self.context_fields:
114
+ if _item_context_fields:
115
+ _items.append(_item_context_fields.to_dict())
116
+ _dict['contextFields'] = _items
108
117
  # override the default output from pydantic by calling `to_dict()` of group
109
118
  if self.group:
110
119
  _dict['group'] = self.group.to_dict()
@@ -148,6 +157,11 @@ class RepositoryDto(BaseModel):
148
157
  if self.product_units is None and "product_units" in self.model_fields_set:
149
158
  _dict['productUnits'] = None
150
159
 
160
+ # set to None if context_fields (nullable) is None
161
+ # and model_fields_set contains the field
162
+ if self.context_fields is None and "context_fields" in self.model_fields_set:
163
+ _dict['contextFields'] = None
164
+
151
165
  # set to None if lines_count (nullable) is None
152
166
  # and model_fields_set contains the field
153
167
  if self.lines_count is None and "lines_count" in self.model_fields_set:
@@ -189,6 +203,7 @@ class RepositoryDto(BaseModel):
189
203
  "owner": CollaboratorDto.from_dict(obj["owner"]) if obj.get("owner") is not None else None,
190
204
  "tags": [TagDto.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None,
191
205
  "productUnits": [ProductUnitNameDto.from_dict(_item) for _item in obj["productUnits"]] if obj.get("productUnits") is not None else None,
206
+ "contextFields": [RepositoryContextFieldDto.from_dict(_item) for _item in obj["contextFields"]] if obj.get("contextFields") is not None else None,
192
207
  "issuesCount": obj.get("issuesCount"),
193
208
  "linesCount": obj.get("linesCount"),
194
209
  "score": obj.get("score"),