UNPKG

fitbit-api-client

Version:
34 lines 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProfileResponseFromJson = ProfileResponseFromJson; const types_utils_1 = require("../utils/types.utils"); /** * プロフィール情報レスポンスをJSONから取得する * @param json * @return ProfileResponse */ function ProfileResponseFromJson(json) { return { user: UserDataFromJson((0, types_utils_1.get)(json, 'user')), }; } /** * ユーザーデータをJSONから取得する * @param json * @return UserData */ function UserDataFromJson(json) { return { age: (0, types_utils_1.get)(json, 'age'), dateOfBirth: (0, types_utils_1.get)(json, 'dateOfBirth'), displayName: (0, types_utils_1.get)(json, 'displayName'), encodedId: (0, types_utils_1.get)(json, 'encodedId'), fullName: (0, types_utils_1.get)(json, 'fullName'), firstName: (0, types_utils_1.getOptionalValue)(json, 'firstName'), lastName: (0, types_utils_1.getOptionalValue)(json, 'lastName'), gender: (0, types_utils_1.get)(json, 'gender'), height: (0, types_utils_1.get)(json, 'height'), offsetFromUTCMillis: (0, types_utils_1.get)(json, 'offsetFromUTCMillis'), }; } //# sourceMappingURL=profile.js.map