public GrantResourcesWithPermissions GetTokensByResource(PNResourceType resourceType)
        {
            GrantResourcesWithPermissions grantResourcesWithPermissions = InitGrantResourcesWithPermissions();

            switch (resourceType)
            {
            case PNResourceType.PNChannels:
                grantResourcesWithPermissions.Channels        = Tokens.Channels;
                grantResourcesWithPermissions.ChannelsPattern = Tokens.ChannelsPattern;
                break;

            case PNResourceType.PNGroups:
                grantResourcesWithPermissions.Groups        = Tokens.Groups;
                grantResourcesWithPermissions.GroupsPattern = Tokens.GroupsPattern;
                break;

            case PNResourceType.PNSpaces:
                grantResourcesWithPermissions.Spaces        = Tokens.Spaces;
                grantResourcesWithPermissions.SpacesPattern = Tokens.SpacesPattern;
                break;

            case PNResourceType.PNUsers:
                grantResourcesWithPermissions.Users        = Tokens.Users;
                grantResourcesWithPermissions.UsersPattern = Tokens.UsersPattern;
                break;

            default:
                #if (ENABLE_PUBNUB_LOGGING)
                this.PubNubInstance.PNLog.WriteToLog(string.Format("No match on GetTokensByResource: {0}", resourceType), PNLoggingMethod.LevelInfo);
                #endif

                break;
            }

            return(grantResourcesWithPermissions);
        }
 public void CleanUp()
 {
     Tokens = null;
 }
 public TokenManager(PubNubUnity pn)
 {
     Tokens         = InitGrantResourcesWithPermissions();
     PubNubInstance = pn;
 }