def identifier_create(args):
    """
    Create a new identifier
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))
    args = set_checksum_args(args)
    if args.get('locations'):
        args['location'] = args.pop('locations')
    return client.create_identifier(**args)
def identifier_update(args):
    """
    Update the state of an identifier
    """
    client = identifiers_client(config)
    identifier_id = args.identifier
    args = clear_internal_args(vars(args))
    args = set_checksum_args(args)
    if args.get('locations'):
        args['location'] = args.pop('locations')
    return client.update_identifier(identifier_id, **args)
def namespace_create(args):
    """
    Create a new namespace
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))
    # Convenience helper: If user doesn't specify a member
    # group, just use the same group as for admins.
    # This means all members will be admins.
    if 'creators' not in args:
        args['creators'] = args['admins']
    return client.create_namespace(**args)
def namespace_update(args):
    """
    Update the properties of an existing namespace
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))

    # Convenience helper: If user doesn't specify a member
    # group, just use the same group as for admins.
    # This means all members will be admins.
    if 'creators' not in args:
        args['creators'] = args['admins']
    namespace_id = args.pop('namespace_id')
    return client.update_namespace(namespace_id, **args)
def identifier_from_checksum(args):
    client = identifiers_client(config)
    return client.get_identifier_from_checksum(args.checksum, args.function)
def identifier_display(args):
    """
    Display the state of an identifier
    """
    client = identifiers_client(config)
    return client.get_identifier(args.identifier)
def namespace_delete(args):
    """
    Remove an existing namespace
    """
    client = identifiers_client(config)
    return client.delete_namespace(args.namespace_id)
def namespace_display(args):
    """
    Display a namespace
    """
    client = identifiers_client(config)
    return client.get_namespace(args.namespace_id)