JsonObject* SamiCloudSearch::asJsonObject() { JsonObject *pJsonObject = new JsonObject(); pJsonObject->Construct(); JsonString *pQueryKey = new JsonString(L"query"); pJsonObject->Add(pQueryKey, toJson(getPQuery(), "SamiFilterBody", "")); JsonString *pSortKey = new JsonString(L"sort"); pJsonObject->Add(pSortKey, toJson(getPSort(), "String", "array")); JsonString *pCollectionNameKey = new JsonString(L"collectionName"); pJsonObject->Add(pCollectionNameKey, toJson(getPCollectionName(), "String", "")); JsonString *pKeyKey = new JsonString(L"key"); pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", "")); JsonString *pSkipKey = new JsonString(L"skip"); pJsonObject->Add(pSkipKey, toJson(getPSkip(), "Integer", "")); JsonString *pLimitKey = new JsonString(L"limit"); pJsonObject->Add(pLimitKey, toJson(getPLimit(), "Integer", "")); return pJsonObject; }
PortcullisStateAction* Portcullis::checkInteraction() { PortcullisStateAction* gateAction = NULL; if ((state == OPEN_STATE || state == CLOSED_STATE) && checkKeyTouch(key)) { // Toggle the port state state++; allowsEntry = true; // Either the gate is now opening and active or now closing but still active // If we are in the same room, broadcast the state change gateAction = new PortcullisStateAction(getPKey(), state, allowsEntry); } return gateAction; }
JsonObject* SamiQueueBody::asJsonObject() { JsonObject *pJsonObject = new JsonObject(); pJsonObject->Construct(); JsonString *pDocumentKey = new JsonString(L"document"); pJsonObject->Add(pDocumentKey, toJson(getPDocument(), "SamiQueue", "")); JsonString *pKeyKey = new JsonString(L"key"); pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", "")); return pJsonObject; }
JsonObject* SamiPasswordChangeBody::asJsonObject() { JsonObject *pJsonObject = new JsonObject(); pJsonObject->Construct(); JsonString *pOldPasswordKey = new JsonString(L"oldPassword"); pJsonObject->Add(pOldPasswordKey, toJson(getPOldPassword(), "String", "")); JsonString *pNewPasswordKey = new JsonString(L"newPassword"); pJsonObject->Add(pNewPasswordKey, toJson(getPNewPassword(), "String", "")); JsonString *pKeyKey = new JsonString(L"key"); pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", "")); return pJsonObject; }