Skip to content
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

customProperties attribute gets not generated for Create List #424

Open
MaxSchaefer opened this issue Oct 28, 2024 · 0 comments
Open

customProperties attribute gets not generated for Create List #424

MaxSchaefer opened this issue Oct 28, 2024 · 0 comments

Comments

@MaxSchaefer
Copy link

MaxSchaefer commented Oct 28, 2024

The Create list endpoint has the ability to directly attach custom properties during the creation of a list. The attribute customProperties gets not exposed in the generated client PHP client library of this repository.

"hubspot/api-client": "^10.3",

Our (@onemedialis) workaround:

/**
 * ListCreateRequestWithCustomProperties allows us to use "customProperties" with ListCreateRequest.
 * The attribute "customProperties" is not implemented in ListCreateRequest.
 */
class ListCreateRequestWithCustomProperties extends \HubSpot\Client\Crm\Lists\Model\ListCreateRequest
{
    public static function openAPITypes()
    {
        return [
            ...parent::openAPITypes(),
            'custom_properties' => 'array'
        ];
    }

    public static function openAPIFormats()
    {
        return [
            ...parent::openAPIFormats(),
            'custom_properties' => null
        ];
    }

    public static function attributeMap()
    {
        return [
            ...parent::attributeMap(),
            'custom_properties' => 'customProperties'
        ];
    }

    public static function setters()
    {
        return [
            ...parent::setters(),
            'custom_properties' => 'setCustomProperties'
        ];
    }

    public static function getters()
    {
        return [
            ...parent::getters(),
            'custom_properties' => 'getCustomProperties'
        ];
    }

    public function __construct(array $data = null)
    {
        parent::__construct($data);
        $this->container['custom_properties'] = $data['custom_properties'] ?? [];
    }

    public function getCustomProperties(): array
    {
        return $this->container['custom_properties'];
    }

    public function setCustomProperties(array $customProperties): self
    {
        $this->container['custom_properties'] = $customProperties;
        return $this;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant