def Run(self, args):
     """Call corresponding APIs based on the flag."""
     response = utils.SettingsClient().DescribeService(args)
     configs = response.modules.additionalProperties if response.modules else []
     config = [p.value for p in configs if p.key == args.module]
     if config:
         return config[0]
     else:
         log.err.Print('No effective setting found for module {}'.format(
             args.module))
         return None
Esempio n. 2
0
 def Run(self, args):
   """Call corresponding APIs based on the flag."""
   response = utils.SettingsClient().DescribeServiceExplicit(args)
   configs = response.modules.additionalProperties if response.modules else []
   state = [
       p.value.moduleEnablementState for p in configs if p.key == args.module
   ]
   if state:
     return state[0]
   else:
     log.status.Print(
         'No setting found for module {}. The module may not exist or no explicit setting is set.'
         .format(args.module))
     return None
 def Run(self, args):
     """Call corresponding APIs based on the flag."""
     # Inherit doesn't accept this arg but utils called require it so set it to
     # an innocuous value.
     args.organization = None
     return utils.SettingsClient().InheritService(args)
Esempio n. 4
0
 def Run(self, args):
   """Call corresponding APIs based on the flag."""
   return utils.SettingsClient().EnableService(args)
Esempio n. 5
0
 def Run(self, args):
     """Call corresponding APIs based on the flag."""
     return utils.SettingsClient().DescribeServiceExplicit(args)
 def Run(self, args):
     """Call corresponding APIs based on the flag."""
     return utils.SettingsClient().UpdateModuleConfig(args)
Esempio n. 7
0
 def Run(self, args):
   """Call corresponding APIs based on the flag."""
   return utils.SettingsClient().DisableModule(args)