Skip to content

Commit

Permalink
Test flaw reference delete
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubFrejlach committed Jun 28, 2023
1 parent bca3ede commit da9940a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

def _get_kwargs(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
) -> Dict[str, Any]:
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format(
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format(
client.base_url,
flaw_id=flaw_id,
uuid=uuid,
id=id,
)

headers: Dict[str, Any] = client.get_headers()
Expand Down Expand Up @@ -61,13 +61,13 @@ def _build_response(

def sync_detailed(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
) -> Response[OsidbApiV1FlawsReferencesDestroyResponse204]:
kwargs = _get_kwargs(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
)

Expand All @@ -84,14 +84,14 @@ def sync_detailed(

def sync(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse204]:
""" """

return sync_detailed(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
).parsed
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

def _get_kwargs(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
exclude_fields: Union[Unset, None, List[str]] = UNSET,
include_fields: Union[Unset, None, List[str]] = UNSET,
include_meta_attr: Union[Unset, None, List[str]] = UNSET,
) -> Dict[str, Any]:
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format(
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format(
client.base_url,
flaw_id=flaw_id,
uuid=uuid,
id=id,
)

headers: Dict[str, Any] = client.get_headers()
Expand Down Expand Up @@ -97,7 +97,7 @@ def _build_response(

def sync_detailed(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
exclude_fields: Union[Unset, None, List[str]] = UNSET,
Expand All @@ -106,7 +106,7 @@ def sync_detailed(
) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]:
kwargs = _get_kwargs(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
exclude_fields=exclude_fields,
include_fields=include_fields,
Expand All @@ -126,7 +126,7 @@ def sync_detailed(

def sync(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
exclude_fields: Union[Unset, None, List[str]] = UNSET,
Expand All @@ -137,7 +137,7 @@ def sync(

return sync_detailed(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
exclude_fields=exclude_fields,
include_fields=include_fields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@

def _get_kwargs(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
form_data: FlawReference,
multipart_data: FlawReference,
json_body: FlawReference,
) -> Dict[str, Any]:
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format(
url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format(
client.base_url,
flaw_id=flaw_id,
uuid=uuid,
id=id,
)

headers: Dict[str, Any] = client.get_headers()
Expand Down Expand Up @@ -75,7 +75,7 @@ def _build_response(

def sync_detailed(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
form_data: FlawReference,
Expand All @@ -84,7 +84,7 @@ def sync_detailed(
) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]:
kwargs = _get_kwargs(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
form_data=form_data,
multipart_data=multipart_data,
Expand All @@ -104,7 +104,7 @@ def sync_detailed(

def sync(
flaw_id: str,
uuid: str,
id: str,
*,
client: AuthenticatedClient,
form_data: FlawReference,
Expand All @@ -115,7 +115,7 @@ def sync(

return sync_detailed(
flaw_id=flaw_id,
uuid=uuid,
id=id,
client=client,
form_data=form_data,
multipart_data=multipart_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class FlawReferencePost(OSIDBModel):
"""FlawReference serializer"""

flaw: str
url: str
uuid: str
embargoed: bool
Expand All @@ -24,7 +23,6 @@ class FlawReferencePost(OSIDBModel):
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
flaw = self.flaw
url = self.url
uuid = self.uuid
embargoed = self.embargoed
Expand All @@ -40,8 +38,6 @@ def to_dict(self) -> Dict[str, Any]:

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
if flaw is not UNSET:
field_dict["flaw"] = flaw
if url is not UNSET:
field_dict["url"] = url
if uuid is not UNSET:
Expand All @@ -58,7 +54,6 @@ def to_dict(self) -> Dict[str, Any]:
return field_dict

def to_multipart(self) -> Dict[str, Any]:
flaw = self.flaw if self.flaw is UNSET else (None, str(self.flaw), "text/plain")
url = self.url if self.url is UNSET else (None, str(self.url), "text/plain")
uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain")
embargoed = (
Expand Down Expand Up @@ -87,8 +82,6 @@ def to_multipart(self) -> Dict[str, Any]:
for key, value in self.additional_properties.items()
}
)
if flaw is not UNSET:
field_dict["flaw"] = flaw
if url is not UNSET:
field_dict["url"] = url
if uuid is not UNSET:
Expand All @@ -107,8 +100,6 @@ def to_multipart(self) -> Dict[str, Any]:
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
flaw = d.pop("flaw", UNSET)

url = d.pop("url", UNSET)

uuid = d.pop("uuid", UNSET)
Expand All @@ -132,7 +123,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
type = FlawReferenceType(_type)

flaw_reference_post = cls(
flaw=flaw,
url=url,
uuid=uuid,
embargoed=embargoed,
Expand All @@ -147,7 +137,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
@staticmethod
def get_fields():
return {
"flaw": str,
"url": str,
"uuid": str,
"embargoed": bool,
Expand Down
31 changes: 8 additions & 23 deletions osidb_bindings/openapi_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,6 @@ paths:
name: flaw_id
schema:
type: string
format: uuid
required: true
- in: query
name: include_fields
Expand Down Expand Up @@ -2836,7 +2835,6 @@ paths:
name: flaw_id
schema:
type: string
format: uuid
required: true
tags:
- osidb
Expand Down Expand Up @@ -2873,7 +2871,7 @@ paths:
version:
type: string
description: ''
/osidb/api/v1/flaws/{flaw_id}/references/{uuid}:
/osidb/api/v1/flaws/{flaw_id}/references/{id}:
get:
operationId: osidb_api_v1_flaws_references_retrieve
parameters:
Expand All @@ -2890,7 +2888,11 @@ paths:
name: flaw_id
schema:
type: string
format: uuid
required: true
- in: path
name: id
schema:
type: string
required: true
- in: query
name: include_fields
Expand All @@ -2913,13 +2915,6 @@ paths:
wildcards eg. `include_meta_attr=*,related_model.*` for retrieving all the
keys from meta_attr. Omit this parameter to not include meta_attr fields
at all. '
- in: path
name: uuid
schema:
type: string
format: uuid
description: A UUID string identifying this flaw reference.
required: true
tags:
- osidb
security:
Expand Down Expand Up @@ -2951,14 +2946,11 @@ paths:
name: flaw_id
schema:
type: string
format: uuid
required: true
- in: path
name: uuid
name: id
schema:
type: string
format: uuid
description: A UUID string identifying this flaw reference.
required: true
tags:
- osidb
Expand Down Expand Up @@ -3002,14 +2994,11 @@ paths:
name: flaw_id
schema:
type: string
format: uuid
required: true
- in: path
name: uuid
name: id
schema:
type: string
format: uuid
description: A UUID string identifying this flaw reference.
required: true
tags:
- osidb
Expand Down Expand Up @@ -5962,9 +5951,6 @@ components:
properties:
description:
type: string
flaw:
type: string
format: uuid
type:
$ref: '#/components/schemas/FlawReferenceType'
url:
Expand All @@ -5987,7 +5973,6 @@ components:
required:
- created_dt
- embargoed
- flaw
- url
- uuid
FlawReferenceType:
Expand Down

0 comments on commit da9940a

Please sign in to comment.