Esempio n. 1
0
        public void Run(string groupName, RestCreateGroupCallback inCallback)
        {
            var data = new CreateGroupData()
            {
                name = groupName
            };

            RestManager.Post(this, RestManager.Request.CREATE_GROUP, TinyJSON.Encoder.Encode(data, TinyJSON.EncodeOptions.NoTypeHints), CreateGroupReply);
            doneCallback = inCallback;
        }
Esempio n. 2
0
        public void Run(string username, string password, RestLoginCallback inCallback)
        {
            var userData = new RestLoginRequestData()
            {
                username = username,
                password = password
            };

            RestManager.Post(this, RestManager.Request.USER_LOGIN, TinyJSON.Encoder.Encode(userData), LoginReply);
            doneCallback = inCallback;
        }
Esempio n. 3
0
        //public void Run(string assetID, string json, RestUpdateAssetMetadataCallback inCallback)
        //{
        //    doneCallback = inCallback;

        //    var metadata = new RestUpdateAssetMetadataRequest()
        //    {
        //        metadata = json
        //    };

        //    RestManager.Post(this, string.Format(RestManager.Request.UPDATE_ASSET_METADATA, assetID), TinyJSON.Encoder.Encode(metadata, TinyJSON.EncodeOptions.NoTypeHints), OnUpdateAssetMetadataResponse);
        //}

        public void Run(string assetID, Spaces.Core.Asset.Metadata json, RestUpdateAssetMetadataCallback inCallback)
        {
            doneCallback = inCallback;

            var metadata = new RestUpdateAssetMetadataRequest()
            {
                metadata = JsonUtility.ToJson(json)
            };

            RestManager.Post(this, string.Format(RestManager.Request.UPDATE_ASSET_METADATA, assetID), TinyJSON.Encoder.Encode(metadata, TinyJSON.EncodeOptions.NoTypeHints), OnUpdateAssetMetadataResponse);
        }
Esempio n. 4
0
        public void Run(ref Spaces.Core.Space createdSpace, string spaceName, RestCreateSpaceCallback inCallback)
        {
            space      = createdSpace;
            space.name = spaceName;

            var data = new CreateSpaceData()
            {
                name = space.name
            };

            RestManager.Post(this, RestManager.Request.CREATE_SPACE, TinyJSON.Encoder.Encode(data, TinyJSON.EncodeOptions.NoTypeHints), CreateSpaceReply);
            doneCallback = inCallback;
        }
Esempio n. 5
0
        public void Run(string spaceID, string json, RestUpdateSpaceMetadataCallback inCallback)
        {
            doneCallback = inCallback;
            this.spaceID = spaceID;
            jsonMetadata = json;
            string request = string.Format(RestManager.Request.UPDATE_SPACE_METADATA, spaceID);

            var metadata = new RestUpdateSpaceMetadataRequest()
            {
                metadata = json
            };

            RestManager.Post(this, request, TinyJSON.Encoder.Encode(metadata, TinyJSON.EncodeOptions.NoTypeHints), GetSpaceMetadataResponse);
        }
Esempio n. 6
0
        public void Run(string userName, string eMail, string first, string last, string middle, string password, RestCreateUserCallback inCallback)
        {
            var data = new CreateUserData()
            {
                username       = userName,
                first_name     = first,
                middle_initial = middle,
                last_name      = last,
                password       = password,
                email          = eMail
            };

            RestManager.Post(this, RestManager.Request.CREATE_USER, TinyJSON.Encoder.Encode(data, TinyJSON.EncodeOptions.NoTypeHints), CreateUserReply);
            doneCallback = inCallback;
        }
Esempio n. 7
0
        public void Run(string assetName, string assetType, string originalFileName, RestCreateAssetCallback inCallback)
        {
            asset                  = new Spaces.Core.Asset();
            asset.name             = assetName;
            asset.assetType        = assetType;
            asset.originalFileName = originalFileName;
            //createdWithRef = false;

            var args = new CreateAssetData()
            {
                asset_type     = asset.assetType,
                name           = asset.name,
                orig_file_name = asset.originalFileName
            };

            RestManager.Post(this, RestManager.Request.CREATE_ASSET, TinyJSON.Encoder.Encode(args, TinyJSON.EncodeOptions.NoTypeHints), CreateAssetReply);
            doneCallback = inCallback;
        }
Esempio n. 8
0
        public void Run(RestLogoutCallback inCallback)
        {
            RestManager.Post(this, RestManager.Request.USER_LOGOUT, "", LogoutResponse);

            doneCallback = inCallback;
        }