'Initializes a resource.
:param name: The name of the resource, i.e., "instances".
:param flag: The name of the flag or configuration option
:param plural_name: Plural form of the resource name. If not
specified, it is generated automatically by
appending an \'s\' to the resource name, unless
it ends with a \'y\'. In that case the last
letter is removed, and \'ies\' is appended.
Dashes are always converted to underscores.'

def __init__(self, name, flag, plural_name=None):

    self.name = name
    if plural_name:
        self.plural_name = plural_name
    elif (self.name[(-1)] == 'y'):
        self.plural_name = ('%sies' % self.name[:(-1)])
    else:
        self.plural_name = ('%ss' % self.name)
    self.plural_name = self.plural_name.replace('-', '_')
    self.flag = flag
