(self, api, value, def_dict)
Construct an auth scope.

    Args:
      api: (Api) The Api which owns this Property
      value: (string) The unique identifier of this scope, often a URL
      def_dict: (dict) The discovery dictionary for this auth scope.
Construct an auth scope.
Construct an auth scope .
def __init__(self, api, value, def_dict):
    """Construct an auth scope.

    Args:
      api: (Api) The Api which owns this Property
      value: (string) The unique identifier of this scope, often a URL
      def_dict: (dict) The discovery dictionary for this auth scope.
    """
    super(AuthScope, self).__init__(def_dict, api, wire_name=value)
    self._module = api.module
    self.SetTemplateValue('value', value)
    while value.endswith('/'):
      value = value[:-1]
    if 'description' not in self.values:
      self.SetTemplateValue('description', value)

    # Strip the common prefix to get a unique identifying name
    if value.startswith(AuthScope.GOOGLE_PREFIX):
      scope_id = value[len(AuthScope.GOOGLE_PREFIX):]
    elif value.startswith(AuthScope.HTTPS_PREFIX):
      # some comon scopes are are just a URL
      scope_id = value[len(AuthScope.HTTPS_PREFIX):]
    else:
      scope_id = value
    # We preserve the value stripped of the most common prefixes so we can
    # use it for building constantName in templates.
    self.SetTemplateValue('lastPart', scope_id)

    # replace all non alphanumeric with '_' to form 'name'
    name = ''.join([(c if c.isalnum() else '_') for c in scope_id.upper()])
    self.SetTemplateValue('name', name)
def __init__ ( self , api , value , def_dict ) : super ( AuthScope , self ) . __init__ ( def_dict , api , wire_name = value ) self . _module = api . module self . SetTemplateValue ( 'value' , value ) while value . endswith ( '/' ) : value = value [ : - 1 ] if 'description' not in self . values : self . SetTemplateValue ( 'description' , value ) # Strip the common prefix to get a unique identifying name if value . startswith ( AuthScope . GOOGLE_PREFIX ) : scope_id = value [ len ( AuthScope . GOOGLE_PREFIX ) : ] elif value . startswith ( AuthScope . HTTPS_PREFIX ) : # some comon scopes are are just a URL scope_id = value [ len ( AuthScope . HTTPS_PREFIX ) : ] else : scope_id = value # We preserve the value stripped of the most common prefixes so we can # use it for building constantName in templates. self . SetTemplateValue ( 'lastPart' , scope_id ) # replace all non alphanumeric with '_' to form 'name' name = '' . join ( [ ( c if c . isalnum ( ) else '_' ) for c in scope_id . upper ( ) ] ) self . SetTemplateValue ( 'name' , name )