Пример #1
0
def user_exists(username):
    """Return True if the username exists, or False if it doesn't."""
    try:
        adobe_api.AdobeAPIObject(username)
    except adobe_api.AdobeAPINoUserException:
        return False
    return True
Пример #2
0
def api_reachable():
    """Return True if the API is reachable."""
    try:
        adobe_api.AdobeAPIObject("*****@*****.**", allow_nonexistent_user=True)
    except (adobe_api.AdobeAPIBadStatusException,
            adobe_api.AdobeAPIMissingRequirementsException):
        return False
    return True
Пример #3
0
def does_user_have_product(product, username):
    """Return True/False if a user has the specified product."""
    try:
        instance = adobe_api.AdobeAPIObject(username)
    except adobe_api.AdobeAPINoUserException:
        return False

    return instance.has_product(product)
Пример #4
0
def user_is_federated(username):
    """
  Return if the username exists and is federated.

  If the username does not exist, the result will be False.
  """
    instance = adobe_api.AdobeAPIObject(username)
    if instance.user and instance.is_federated():
        return True
    return False
Пример #5
0
def user_is_federated(username):
    """
    Return if the username exists and is federated.

    If the username does not exist, the result will be False.
    """
    try:
        instance = adobe_api.AdobeAPIObject(username)
    except adobe_api.AdobeAPINoUserException:
        return False
    return instance.is_federated()
Пример #6
0
def remove_products(removed_products, username):
    """Remove products from specific user."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.remove_product_from_user(removed_products)
Пример #7
0
def user_exists(username):
    """Return if the username exists."""
    instance = adobe_api.AdobeAPIObject(username)
    if instance.user:
        return True
    return False
Пример #8
0
def add_products(desired_products, username):
    """Add products to specific user."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.add_products_to_user(desired_products)
Пример #9
0
def remove_user(username):
    """Remove user account from organization."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.remove_user_from_org(username)
Пример #10
0
def add_federated_user(username, email, firstname, lastname, country='US'):
    """Add federated user account."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.add_federated_user(email, country, firstname, lastname)
Пример #11
0
def get_product_list():
    """Return a list of product configs available."""
    instance = adobe_api.AdobeAPIObject("*****@*****.**")
    productlist = instance.gather_product_list()
    return [x['groupName'] for x in productlist]
Пример #12
0
def does_product_exist(productname):
    """Return True if a product config exists."""
    instance = adobe_api.AdobeAPIObject("*****@*****.**")
    return instance.product_exists(productname)
Пример #13
0
def list_user_products(username):
    """Return a list of the user's product configs."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.list_products()
Пример #14
0
def does_user_have_product(product, username):
    """Return True/False if a user has the specified product."""
    instance = adobe_api.AdobeAPIObject(username)
    return instance.has_product(product)