Пример #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)
 def Args(parser):
   """Adds command-specific args."""
   flags.AddContactIdArg(parser)
   flags.AddNotificationCategoriesArg(
       parser, contacts.GetContactNotificationCategoryEnum())
   flags.AddLanugageArg(parser)
   flags.AddParentArgs(parser)
Пример #3
0
 def Args(parser):
   """Adds command-specific args."""
   flags.AddEmailArg(parser, required=True)
   flags.AddNotificationCategoriesArg(
       parser, contacts.GetContactNotificationCategoryEnum(), required=True)
   flags.AddLanugageArg(parser, required=True)
   flags.AddParentArgs(parser)
Пример #4
0
 def Args(parser):
     """Adds command-specific args."""
     flags.AddNotificationCategoriesArg(
         parser,
         contacts.GetContactNotificationCategoryEnum(),
         required=True)
     flags.AddParentArgs(parser)
     base.URI_FLAG.RemoveFromParser(parser)
  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)