Skip to content

Serialize JSONObject in MappedObject #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

zliang-akamai
Copy link
Member

@zliang-akamai zliang-akamai commented Apr 17, 2024

📝 Description

This is to fully serialize a JSONObject in MappedObject's dict property.

✔️ How to Test

Automated Testing

make testunit

Manual Testing

import os
from linode_api4 import LinodeClient


client = LinodeClient(os.getenv("LINODE_TOKEN"))

vpc = client.vpcs.create(
    "my-vpc",
    "us-mia",
    subnets=[{"label": "my-subnet", "ipv4": "10.0.0.0/24"}],
)

instance, _ = client.linode.instance_create(
    ltype="g6-nanode-1",
    region="us-mia",
    image="linode/ubuntu22.04",
    label="my-ubuntu-linode22",
    interfaces=[
        {
            "purpose": "vpc",
            "subnet_id": vpc.subnets[0].id,
        },
    ],
)

print(instance.ips.dict)

instance.delete()
vpc.delete()

Verify the vpc IP addresses list now contain valid dict, rather than a JSONObject object.

@zliang-akamai zliang-akamai requested a review from a team as a code owner April 17, 2024 21:28
@zliang-akamai zliang-akamai requested review from ykim-akamai and yec-akamai and removed request for a team April 17, 2024 21:28
@zliang-akamai zliang-akamai added the enhancement issues that request a enhancement label Apr 17, 2024
@zliang-akamai zliang-akamai changed the title Serialize JSONObject inMappedObject Serialize JSONObject in MappedObject Apr 17, 2024
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work!

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well on my end!

@zliang-akamai zliang-akamai merged commit b0920fd into dev Apr 18, 2024
9 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/serialize-jsonobject-in-mappedobject branch April 18, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that request a enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants