Skip to content

Commit

Permalink
Updated with build 6e200819-aa66-4dd6-8ae5-56b0a4fcbedb from OmniCore…
Browse files Browse the repository at this point in the history
…-SDK-Generator commit dea01cf2a7280f4465ea0b5ee51eea57aa59fe60
  • Loading branch information
jaisonjayan committed Nov 22, 2023
1 parent 348cd24 commit 69a774f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
18 changes: 9 additions & 9 deletions OmniCore/models/metrics_response_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ class MetricsResponseDetails(BaseModel):
no_of_files: Optional[StrictInt] = Field(None, alias="noOfFiles")
file_size: Optional[StrictFloat] = Field(None, alias="fileSize")
noofoperations: Optional[StrictInt] = None
no_of_replays: Optional[StrictFloat] = Field(None, alias="noOfReplays")
no_of_exports: Optional[StrictFloat] = Field(None, alias="noOfExports")
operations: Optional[List[OperationMetrics]] = Field(None, alias="Operations")
details_for_time_period: Optional[List[MetricsData]] = Field(None, alias="detailsForTimePeriod")
__properties = ["subscriptionId", "noOfFiles", "fileSize", "noofoperations", "Operations", "detailsForTimePeriod"]
details_for_time_period: Optional[MetricsData] = Field(None, alias="detailsForTimePeriod")
__properties = ["subscriptionId", "noOfFiles", "fileSize", "noofoperations", "noOfReplays", "noOfExports", "Operations", "detailsForTimePeriod"]

class Config:
allow_population_by_field_name = True
Expand Down Expand Up @@ -67,13 +69,9 @@ def to_dict(self):
if _item:
_items.append(_item.to_dict())
_dict['Operations'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in details_for_time_period (list)
_items = []
# override the default output from pydantic by calling `to_dict()` of details_for_time_period
if self.details_for_time_period:
for _item in self.details_for_time_period:
if _item:
_items.append(_item.to_dict())
_dict['detailsForTimePeriod'] = _items
_dict['detailsForTimePeriod'] = self.details_for_time_period.to_dict()
return _dict

@classmethod
Expand All @@ -90,8 +88,10 @@ def from_dict(cls, obj: dict) -> MetricsResponseDetails:
"no_of_files": obj.get("noOfFiles"),
"file_size": obj.get("fileSize"),
"noofoperations": obj.get("noofoperations"),
"no_of_replays": obj.get("noOfReplays"),
"no_of_exports": obj.get("noOfExports"),
"operations": [OperationMetrics.from_dict(_item) for _item in obj.get("Operations")] if obj.get("Operations") is not None else None,
"details_for_time_period": [MetricsData.from_dict(_item) for _item in obj.get("detailsForTimePeriod")] if obj.get("detailsForTimePeriod") is not None else None
"details_for_time_period": MetricsData.from_dict(obj.get("detailsForTimePeriod")) if obj.get("detailsForTimePeriod") is not None else None
})
return _obj

4 changes: 3 additions & 1 deletion docs/MetricsResponseDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ Name | Type | Description | Notes
**no_of_files** | **int** | | [optional]
**file_size** | **float** | | [optional]
**noofoperations** | **int** | | [optional]
**no_of_replays** | **float** | | [optional]
**no_of_exports** | **float** | | [optional]
**operations** | [**List[OperationMetrics]**](OperationMetrics.md) | | [optional]
**details_for_time_period** | [**List[MetricsData]**](MetricsData.md) | | [optional]
**details_for_time_period** | [**MetricsData**](MetricsData.md) | | [optional]

## Example

Expand Down
28 changes: 14 additions & 14 deletions test/test_metrics_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def make_instance(self, include_optional):
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
no_of_replays = 1.337,
no_of_exports = 1.337,
operations = [
OmniCore.models.operation_metrics.OperationMetrics(
no_of_files = 56,
Expand All @@ -53,20 +55,18 @@ def make_instance(self, include_optional):
updatedon = '',
registryid = '', )
],
details_for_time_period = [
OmniCore.models.metrics_data.MetricsData(
data = [
OmniCore.models.metrics_logs.MetricsLogs(
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
updatedon = '',
no_of_replays = 56,
no_of_exports = 56, )
],
total_exports = 56,
total_replays = 56, )
], )
details_for_time_period = OmniCore.models.metrics_data.MetricsData(
data = [
OmniCore.models.metrics_logs.MetricsLogs(
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
updatedon = '',
no_of_replays = 56,
no_of_exports = 56, )
],
total_exports = 56,
total_replays = 56, ), )
)
else :
return MetricsResponse(
Expand Down
28 changes: 14 additions & 14 deletions test/test_metrics_response_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def make_instance(self, include_optional):
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
no_of_replays = 1.337,
no_of_exports = 1.337,
operations = [
OmniCore.models.operation_metrics.OperationMetrics(
no_of_files = 56,
Expand All @@ -52,20 +54,18 @@ def make_instance(self, include_optional):
updatedon = '',
registryid = '', )
],
details_for_time_period = [
OmniCore.models.metrics_data.MetricsData(
data = [
OmniCore.models.metrics_logs.MetricsLogs(
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
updatedon = '',
no_of_replays = 56,
no_of_exports = 56, )
],
total_exports = 56,
total_replays = 56, )
]
details_for_time_period = OmniCore.models.metrics_data.MetricsData(
data = [
OmniCore.models.metrics_logs.MetricsLogs(
no_of_files = 56,
file_size = 1.337,
noofoperations = 56,
updatedon = '',
no_of_replays = 56,
no_of_exports = 56, )
],
total_exports = 56,
total_replays = 56, )
)
else :
return MetricsResponseDetails(
Expand Down

0 comments on commit 69a774f

Please sign in to comment.