Ejemplo n.º 1
0
def create_product_catalog(params=None):
    if params is None:
        params = {}

    if 'name' not in params:
        params['name'] = unique_name('Test Catalog ')

    product_catalog = ProductCatalog(None, test_config.business_id)
    product_catalog.update(params)
    product_catalog.remote_create()

    return product_catalog
# As with any software that integrates with the Facebook platform, your use
# of this software is subject to the Facebook Developer Principles and
# Policies [http://developers.facebook.com/policy/]. This copyright notice
# shall be included in all copies or substantial portions of the software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

from facebookads import test_config

business_id = test_config.business_id

# _DOC open [PRODUCTCATALOG_CREATE]
# _DOC vars [business_id]
from facebookads.objects import ProductCatalog

product_catalog = ProductCatalog(parent_id=business_id)

product_catalog[ProductCatalog.Field.name] = 'Catalog'

product_catalog.remote_create()
# _DOC close [PRODUCTCATALOG_CREATE]

product_catalog.remote_delete()