~ci-train-bot/mcloud/mcloud-ubuntu-artful-2884

« back to all changes in this revision

Viewing changes to src/mcloud/api/clouditem.cpp

  • Committer: Gary.Wang
  • Date: 2016-04-20 04:19:28 UTC
  • Revision ID: gary.wang@canonical.com-20160420041928-kdie1pmxxopre8qi
1.remove owner id filed for upload since it's cloud owner if it's empty
2.access token fetched work-flow in compliance with mcloud qml plugin(using refresh token)
3.throw except(domain error) when net error occurs during  http stream upload and download
4.add debian files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2016 Canonical Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU Lesser General Public License version 3,
6
 
 * as published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authored by: Gary Wang <gary.wang@canonical.com>
17
 
 */
18
 
 
19
 
#include <boost/algorithm/string.hpp>
20
 
#include <mcloud/api/clouditem.h>
21
 
 
22
 
#include <json/json.h>
23
 
 
24
 
using namespace mcloud::api;
25
 
using namespace std;
26
 
 
27
 
CloudItem::CloudItem(const json::Value &data) : {
28
 
}
29
 
 
30
 
const string & CloudItem::id() const {
31
 
    return id_;
32
 
}
33
 
 
34
 
const string & CloudItem::name() const {
35
 
    return name_;
36
 
}
37
 
 
38
 
const string & CloudItem::suffix() const {
39
 
    return suffix_;
40
 
}
41
 
 
42
 
const Resource::Type & CloudItem::content_type() const {
43
 
    return content_type_;
44
 
}
45
 
 
46
 
const string & CloudItem::content_size() const {
47
 
    return content_size_;
48
 
}
49
 
 
50
 
const std::time_t & CloudItem::updatedate() const {
51
 
    return updatedate_;
52
 
}
53
 
 
54
 
const string & CloudItem::thumbnail() const {
55
 
    return thumbnail_url_;
56
 
}
57
 
 
58
 
const string & CloudItem::big_thumbnail() const {
59
 
    return big_thumbnail_url_;
60
 
}
61
 
 
62
 
const string & CloudItem::parent_catalog_Id() const {
63
 
    return parent_catalog_id_;
64
 
}
65
 
 
66
 
bool CloudItem::is_shared() const {
67
 
    return is_shared_;
68
 
}
69
 
 
70
 
Resource::Kind CloudItem::kind() const {
71
 
    return Resource::Kind::cloud_content;
72
 
}
73