Exemplo n.º 1
0
 def Run(self, args):
   """Runs the create command."""
   parent_name = util.GetParent(args)
   categories = util.GetNotificationCategories(
       args, contacts.GetContactNotificationCategoryEnum())
   client = contacts.ContactsClient()
   return client.Create(parent_name, args.email, categories, args.language)
Exemplo n.º 2
0
 def Run(self, args):
     """Runs the list command."""
     parent_name = util.GetParent(args)
     client = contacts.ContactsClient()
     return client.List(parent_name,
                        limit=args.limit,
                        page_size=args.page_size)
Exemplo n.º 3
0
    def Run(self, args):
        """Runs the compute contacts command."""
        parent_name = util.GetParent(args)
        notification_category_enum = self._GetNotificationCategoryEnumByParentType(
            parent_name)
        categories = util.GetNotificationCategories(
            args, notification_category_enum)

        client = contacts.ContactsClient()
        return client.Compute(parent_name,
                              categories,
                              limit=args.limit,
                              page_size=args.page_size)
  def Run(self, args):
    """Runs the update command."""
    contact_name = util.GetContactName(args)
    categories = util.GetNotificationCategories(
        args, contacts.GetContactNotificationCategoryEnum())
    language = args.language

    if not language and not categories:
      raise exceptions.MinimumArgumentException(
          ['notification-categories', 'language'])

    client = contacts.ContactsClient()
    return client.Update(contact_name, categories, language)
Exemplo n.º 5
0
 def Run(self, args):
     """Runs the delete command."""
     contact_name = util.GetContactName(args)
     client = contacts.ContactsClient()
     return client.Delete(contact_name)