diff --git a/integration_tests/ads/test_conversion_tags.py b/integration_tests/ads/test_conversion_tags.py index 6fb6f35..8fb0689 100644 --- a/integration_tests/ads/test_conversion_tags.py +++ b/integration_tests/ads/test_conversion_tags.py @@ -18,12 +18,42 @@ def test_create_conversion_tag_success(self): """ conversion_tag = ConversionTag.create( ad_account_id = DEFAULT_AD_ACCOUNT_ID, - name = "Test Conversion Tag" + name = "Test Conversion Tag", + aem_enabled = None, + md_frequency = None, + aem_fnln_enabled = None, + aem_ph_enabled = None, + aem_ge_enabled = None, + aem_db_enabled = None, + aem_loc_enabled = None, ) assert conversion_tag assert getattr(conversion_tag, "_id") assert getattr(conversion_tag, "_name") == "Test Conversion Tag" + assert getattr(conversion_tag.configs, "aem_enabled") == False + + def test_create_conversion_tag_with_configs_success(self): + """ + Test creating a new Conversion Tag successfully + """ + conversion_tag = ConversionTag.create( + ad_account_id = DEFAULT_AD_ACCOUNT_ID, + name = "Test Conversion Tag", + aem_enabled = True, + md_frequency = 1.2, + aem_fnln_enabled = None, + aem_ph_enabled = None, + aem_ge_enabled = None, + aem_db_enabled = None, + aem_loc_enabled = None, + ) + + assert conversion_tag + assert getattr(conversion_tag, "_id") + assert getattr(conversion_tag, "_name") == "Test Conversion Tag" + assert getattr(conversion_tag.configs, "aem_enabled") == True + assert getattr(conversion_tag.configs, "md_frequency") == 1.2 class TestGetConversionTag(BaseTestCase): """ diff --git a/pinterest/ads/conversion_tags.py b/pinterest/ads/conversion_tags.py index ad3bd80..7d0d81f 100644 --- a/pinterest/ads/conversion_tags.py +++ b/pinterest/ads/conversion_tags.py @@ -109,13 +109,13 @@ def create( cls, ad_account_id : str, name : str, - aem_enabled : bool = False, - md_frequency : float = 0.0, - aem_fnln_enabled : bool = False, - aem_ph_enabled : bool = False, - aem_ge_enabled : bool = False, - aem_db_enabled : bool = False, - aem_loc_enabled : bool = False, + aem_enabled : bool = None, + md_frequency : float = None, + aem_fnln_enabled : bool = None, + aem_ph_enabled : bool = None, + aem_ge_enabled : bool = None, + aem_db_enabled : bool = None, + aem_loc_enabled : bool = None, client:PinterestSDKClient = None, **kwargs ) -> ConversionTag: @@ -147,6 +147,24 @@ def create( Args: ad_account_id (str): ConversionTag's Ad Account ID name (str): ConversionTag name + aem_enabled (bool=False, Nullable): Whether Automatic Enhanced Match email is enabled. See\ + Enhanced match for more information. + + md_frequency (float=1.0, Nullable): Metadata ingestion frequency. + aem_fnln_enabled (bool=False, Nullable): Whether Automatic Enhanced Match name is enabled. See\ + Enhanced match for more information. + + aem_ph_enabled (bool=False, Nullable): Whether Automatic Enhanced Match phone is enabled. See\ + Enhanced match for more information. + + aem_ge_enabled (bool=False, Nullable): Whether Automatic Enhanced Match gender is enabled. See\ + Enhanced match for more information. + + aem_db_enabled (bool=False, Nullable): Whether Automatic Enhanced Match birthdate is enabled. See\ + Enhanced match for more information. + + aem_loc_enabled (bool=False, Nullable): Whether Automatic Enhanced Match location is enabled. See\ + Enhanced match for more information. Returns: ConversionTag: ConversionTag Object @@ -171,6 +189,7 @@ def create( map_fn = lambda obj : obj, ) + return cls( ad_account_id = response.ad_account_id, conversion_tag_id = response.id, diff --git a/pinterest/organic/pins.py b/pinterest/organic/pins.py index e1693c4..a36c620 100644 --- a/pinterest/organic/pins.py +++ b/pinterest/organic/pins.py @@ -152,7 +152,6 @@ def create( client:PinterestSDKClient = None, **kwargs ) -> Pin: - # pylint: disable=too-many-arguments """ Create a Pin on a board or board section owned by the "operation user_account". @@ -197,6 +196,7 @@ def create( Returns: Pin: Pin object """ + # pylint: disable=too-many-arguments, no-value-for-parameter if not client: client = cls._get_client() @@ -212,9 +212,9 @@ def create( board_section_id=board_section_id, media_source=media_source, parent_pin_id=parent_pin_id, - **kwargs + **kwargs, ) - ) + ) # pylint: disable=no-value-for-parameter verify_api_response(api_response) return Pin(pin_id=getattr(api_response, "id"), client=client) diff --git a/requirements.txt b/requirements.txt index 00a7736..101fee2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Pinterest-Generated-Client==0.1.5 +Pinterest-Generated-Client==0.1.7 python-dateutil==2.8.2 six==1.16.0 urllib3==1.26.12 diff --git a/setup.py b/setup.py index 2fc5213..edadc0c 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def _get_prod_version(): "python-dateutil", "python-dotenv==0.20.0", "six==1.16.0", - "Pinterest-Generated-Client==0.1.5" + "Pinterest-Generated-Client==0.1.7" ] long_description = (Path(__file__).parent / "README.md").read_text() diff --git a/tests/src/pinterest/ads/test_ad_groups.py b/tests/src/pinterest/ads/test_ad_groups.py index 396c1b3..0b795cc 100644 --- a/tests/src/pinterest/ads/test_ad_groups.py +++ b/tests/src/pinterest/ads/test_ad_groups.py @@ -84,6 +84,7 @@ def test_create_ad_group_model_new_ad_group(self, ad_group_get_mock, ad_group_cr campaign_id=self.test_campaign_id, billable_event='CLICKTHROUGH', name='SDK_TEST_CLIENT_ADGROUP', + auto_targeting_enabled=False ) assert created_ad_group