Example #1
0
def GetValueServiceFromResourceType(resource_type):
    """Returns the value-service from the resource type input.

  Args:
    resource_type: A String object that contains the resource type
  """

    if resource_type == ORGANIZATION:
        value_service = settings_service.OrganizationsSettingsValueService()
    elif resource_type == FOLDER:
        value_service = settings_service.FoldersSettingsValueService()
    else:
        value_service = settings_service.ProjectsSettingsValueService()

    return value_service
Example #2
0
def GetValueServiceFromArgs(args):
    """Returns the value-service from the user-specified arguments.

  Args:
    args: argparse.Namespace, An object that contains the values for the
      arguments specified in the Args method.
  """

    if args.organization:
        value_service = settings_service.OrganizationsSettingsValueService()
    elif args.folder:
        value_service = settings_service.FoldersSettingsValueService()
    else:
        value_service = settings_service.ProjectsSettingsValueService()

    return value_service