Skip to content

[Enhancement] Implementing device adoption #177

@DiscoRiver

Description

@DiscoRiver

Summary

I'd like to implement the v3 adoption resource into DeviceClient: https://console.us.code42.com/swagger/index.html?urls.primaryName=v3#/default/adoption

Proposed API

    def adopt(self, adopting_device_guid, adopted_device_guid):
        """Performs a device adoption.
        `REST Documentation <https://console.us.code42.com/swagger/index.html?urls.primaryName=v3#/default/adoption>__

        Args:
            adopting_device_guid (int): The device performing the adoption.
            adopted_device_guid (int): The device being adopted.

        Returns:
            :class:`py42.response.Py42Response`
        """
        uri = u"/c42api/v3/device/adoption"
        data = {
            u"adoptingGuid": adopting_device_guid,
            u"adoptedGuid": adopted_device_guid,
        }
        return self._session.post(uri, data=json.dumps(data))

This should be a fairly straightforward change, but I'm wondering if DeviceClient is the right place for it? Thoughts would be appreciated :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions