Skip to content

Commit

Permalink
Merge pull request #27 from RedHatProductSecurity/to-dict-fix
Browse files Browse the repository at this point in the history
Fix to_dict transform
  • Loading branch information
JakubFrejlach authored Sep 5, 2023
2 parents 242470e + 8227a21 commit f2ea4ea
Show file tree
Hide file tree
Showing 32 changed files with 233 additions and 231 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- fix usage of query parameters with double underscore
- fix `to_dict` not being able corretly transform UNSET values
of different instances (mainly multiprocessing issue)

## [1.3.9] - 2023-08-25
### Changed
- fix bindings making lot a of uncessary calls when supplying max_results
parameter for async list iterator which is much higher than actual results count
parameter for async list iterator which is much higher than actual results count

## [1.3.8] - 2023-08-25
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if oidc_enabled is not UNSET:
if not isinstance(oidc_enabled, Unset):
field_dict["oidc_enabled"] = oidc_enabled
if user is not UNSET:
if not isinstance(user, Unset):
field_dict["user"] = user
if auth is not UNSET:
if not isinstance(auth, Unset):
field_dict["auth"] = auth

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,29 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if uuid is not UNSET:
if not isinstance(uuid, Unset):
field_dict["uuid"] = uuid
if link is not UNSET:
if not isinstance(link, Unset):
field_dict["link"] = link
if last_changed is not UNSET:
if not isinstance(last_changed, Unset):
field_dict["last_changed"] = last_changed
if created_at is not UNSET:
if not isinstance(created_at, Unset):
field_dict["created_at"] = created_at
if name is not UNSET:
if not isinstance(name, Unset):
field_dict["name"] = name
if relative_url is not UNSET:
if not isinstance(relative_url, Unset):
field_dict["relative_url"] = relative_url
if type is not UNSET:
if not isinstance(type, Unset):
field_dict["type"] = type
if description is not UNSET:
if not isinstance(description, Unset):
field_dict["description"] = description
if products is not UNSET:
if not isinstance(products, Unset):
field_dict["products"] = products
if product_versions is not UNSET:
if not isinstance(product_versions, Unset):
field_dict["product_versions"] = product_versions
if product_streams is not UNSET:
if not isinstance(product_streams, Unset):
field_dict["product_streams"] = product_streams
if product_variants is not UNSET:
if not isinstance(product_variants, Unset):
field_dict["product_variants"] = product_variants

return field_dict
Expand Down
146 changes: 73 additions & 73 deletions component_registry_bindings/bindings/python_client/models/component.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import Any, Dict, List, Tuple, Type, TypeVar, cast
from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast

import attr

Expand Down Expand Up @@ -177,77 +177,77 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if link is not UNSET:
if not isinstance(link, Unset):
field_dict["link"] = link
if download_url is not UNSET:
if not isinstance(download_url, Unset):
field_dict["download_url"] = download_url
if uuid is not UNSET:
if not isinstance(uuid, Unset):
field_dict["uuid"] = uuid
if type is not UNSET:
if not isinstance(type, Unset):
field_dict["type"] = type
if namespace is not UNSET:
if not isinstance(namespace, Unset):
field_dict["namespace"] = namespace
if purl is not UNSET:
if not isinstance(purl, Unset):
field_dict["purl"] = purl
if name is not UNSET:
if not isinstance(name, Unset):
field_dict["name"] = name
if description is not UNSET:
if not isinstance(description, Unset):
field_dict["description"] = description
if related_url is not UNSET:
if not isinstance(related_url, Unset):
field_dict["related_url"] = related_url
if tags is not UNSET:
if not isinstance(tags, Unset):
field_dict["tags"] = tags
if version is not UNSET:
if not isinstance(version, Unset):
field_dict["version"] = version
if release is not UNSET:
if not isinstance(release, Unset):
field_dict["release"] = release
if el_match is not UNSET:
if not isinstance(el_match, Unset):
field_dict["el_match"] = el_match
if arch is not UNSET:
if not isinstance(arch, Unset):
field_dict["arch"] = arch
if nvr is not UNSET:
if not isinstance(nvr, Unset):
field_dict["nvr"] = nvr
if nevra is not UNSET:
if not isinstance(nevra, Unset):
field_dict["nevra"] = nevra
if epoch is not UNSET:
if not isinstance(epoch, Unset):
field_dict["epoch"] = epoch
if copyright_text is not UNSET:
if not isinstance(copyright_text, Unset):
field_dict["copyright_text"] = copyright_text
if license_concluded is not UNSET:
if not isinstance(license_concluded, Unset):
field_dict["license_concluded"] = license_concluded
if license_concluded_list is not UNSET:
if not isinstance(license_concluded_list, Unset):
field_dict["license_concluded_list"] = license_concluded_list
if license_declared is not UNSET:
if not isinstance(license_declared, Unset):
field_dict["license_declared"] = license_declared
if license_declared_list is not UNSET:
if not isinstance(license_declared_list, Unset):
field_dict["license_declared_list"] = license_declared_list
if openlcs_scan_url is not UNSET:
if not isinstance(openlcs_scan_url, Unset):
field_dict["openlcs_scan_url"] = openlcs_scan_url
if openlcs_scan_version is not UNSET:
if not isinstance(openlcs_scan_version, Unset):
field_dict["openlcs_scan_version"] = openlcs_scan_version
if software_build is not UNSET:
if not isinstance(software_build, Unset):
field_dict["software_build"] = software_build
if errata is not UNSET:
if not isinstance(errata, Unset):
field_dict["errata"] = errata
if products is not UNSET:
if not isinstance(products, Unset):
field_dict["products"] = products
if product_versions is not UNSET:
if not isinstance(product_versions, Unset):
field_dict["product_versions"] = product_versions
if product_streams is not UNSET:
if not isinstance(product_streams, Unset):
field_dict["product_streams"] = product_streams
if product_variants is not UNSET:
if not isinstance(product_variants, Unset):
field_dict["product_variants"] = product_variants
if channels is not UNSET:
if not isinstance(channels, Unset):
field_dict["channels"] = channels
if sources is not UNSET:
if not isinstance(sources, Unset):
field_dict["sources"] = sources
if provides is not UNSET:
if not isinstance(provides, Unset):
field_dict["provides"] = provides
if upstreams is not UNSET:
if not isinstance(upstreams, Unset):
field_dict["upstreams"] = upstreams
if manifest is not UNSET:
if not isinstance(manifest, Unset):
field_dict["manifest"] = manifest
if filename is not UNSET:
if not isinstance(filename, Unset):
field_dict["filename"] = filename

return field_dict
Expand Down Expand Up @@ -472,77 +472,77 @@ def to_multipart(self) -> Dict[str, Any]:
for key, value in self.additional_properties.items()
}
)
if link is not UNSET:
if not isinstance(link, Unset):
field_dict["link"] = link
if download_url is not UNSET:
if not isinstance(download_url, Unset):
field_dict["download_url"] = download_url
if uuid is not UNSET:
if not isinstance(uuid, Unset):
field_dict["uuid"] = uuid
if type is not UNSET:
if not isinstance(type, Unset):
field_dict["type"] = type
if namespace is not UNSET:
if not isinstance(namespace, Unset):
field_dict["namespace"] = namespace
if purl is not UNSET:
if not isinstance(purl, Unset):
field_dict["purl"] = purl
if name is not UNSET:
if not isinstance(name, Unset):
field_dict["name"] = name
if description is not UNSET:
if not isinstance(description, Unset):
field_dict["description"] = description
if related_url is not UNSET:
if not isinstance(related_url, Unset):
field_dict["related_url"] = related_url
if tags is not UNSET:
if not isinstance(tags, Unset):
field_dict["tags"] = tags
if version is not UNSET:
if not isinstance(version, Unset):
field_dict["version"] = version
if release is not UNSET:
if not isinstance(release, Unset):
field_dict["release"] = release
if el_match is not UNSET:
if not isinstance(el_match, Unset):
field_dict["el_match"] = el_match
if arch is not UNSET:
if not isinstance(arch, Unset):
field_dict["arch"] = arch
if nvr is not UNSET:
if not isinstance(nvr, Unset):
field_dict["nvr"] = nvr
if nevra is not UNSET:
if not isinstance(nevra, Unset):
field_dict["nevra"] = nevra
if epoch is not UNSET:
if not isinstance(epoch, Unset):
field_dict["epoch"] = epoch
if copyright_text is not UNSET:
if not isinstance(copyright_text, Unset):
field_dict["copyright_text"] = copyright_text
if license_concluded is not UNSET:
if not isinstance(license_concluded, Unset):
field_dict["license_concluded"] = license_concluded
if license_concluded_list is not UNSET:
if not isinstance(license_concluded_list, Unset):
field_dict["license_concluded_list"] = license_concluded_list
if license_declared is not UNSET:
if not isinstance(license_declared, Unset):
field_dict["license_declared"] = license_declared
if license_declared_list is not UNSET:
if not isinstance(license_declared_list, Unset):
field_dict["license_declared_list"] = license_declared_list
if openlcs_scan_url is not UNSET:
if not isinstance(openlcs_scan_url, Unset):
field_dict["openlcs_scan_url"] = openlcs_scan_url
if openlcs_scan_version is not UNSET:
if not isinstance(openlcs_scan_version, Unset):
field_dict["openlcs_scan_version"] = openlcs_scan_version
if software_build is not UNSET:
if not isinstance(software_build, Unset):
field_dict["software_build"] = software_build
if errata is not UNSET:
if not isinstance(errata, Unset):
field_dict["errata"] = errata
if products is not UNSET:
if not isinstance(products, Unset):
field_dict["products"] = products
if product_versions is not UNSET:
if not isinstance(product_versions, Unset):
field_dict["product_versions"] = product_versions
if product_streams is not UNSET:
if not isinstance(product_streams, Unset):
field_dict["product_streams"] = product_streams
if product_variants is not UNSET:
if not isinstance(product_variants, Unset):
field_dict["product_variants"] = product_variants
if channels is not UNSET:
if not isinstance(channels, Unset):
field_dict["channels"] = channels
if sources is not UNSET:
if not isinstance(sources, Unset):
field_dict["sources"] = sources
if provides is not UNSET:
if not isinstance(provides, Unset):
field_dict["provides"] = provides
if upstreams is not UNSET:
if not isinstance(upstreams, Unset):
field_dict["upstreams"] = upstreams
if manifest is not UNSET:
if not isinstance(manifest, Unset):
field_dict["manifest"] = manifest
if filename is not UNSET:
if not isinstance(filename, Unset):
field_dict["filename"] = filename

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if user is not UNSET:
if not isinstance(user, Unset):
field_dict["user"] = user

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if count is not UNSET:
if not isinstance(count, Unset):
field_dict["count"] = count
if next_ is not UNSET:
if not isinstance(next_, Unset):
field_dict["next"] = next_
if previous is not UNSET:
if not isinstance(previous, Unset):
field_dict["previous"] = previous
if results is not UNSET:
if not isinstance(results, Unset):
field_dict["results"] = results

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if count is not UNSET:
if not isinstance(count, Unset):
field_dict["count"] = count
if next_ is not UNSET:
if not isinstance(next_, Unset):
field_dict["next"] = next_
if previous is not UNSET:
if not isinstance(previous, Unset):
field_dict["previous"] = previous
if results is not UNSET:
if not isinstance(results, Unset):
field_dict["results"] = results

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if count is not UNSET:
if not isinstance(count, Unset):
field_dict["count"] = count
if next_ is not UNSET:
if not isinstance(next_, Unset):
field_dict["next"] = next_
if previous is not UNSET:
if not isinstance(previous, Unset):
field_dict["previous"] = previous
if results is not UNSET:
if not isinstance(results, Unset):
field_dict["results"] = results

return field_dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if count is not UNSET:
if not isinstance(count, Unset):
field_dict["count"] = count
if next_ is not UNSET:
if not isinstance(next_, Unset):
field_dict["next"] = next_
if previous is not UNSET:
if not isinstance(previous, Unset):
field_dict["previous"] = previous
if results is not UNSET:
if not isinstance(results, Unset):
field_dict["results"] = results

return field_dict
Expand Down
Loading

0 comments on commit f2ea4ea

Please sign in to comment.