1 /*
2  * Copyright 2009-2017 Alibaba Cloud All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <string>
20 #include <memory>
21 #include <iostream>
22 
23 namespace AlibabaCloud
24 {
25 namespace OSS
26 {
27     class  ServiceResult
28     {
29     public:
ServiceResult()30         ServiceResult() {}
~ServiceResult()31         virtual ~ServiceResult() {};
32 
RequestId()33         inline const std::string& RequestId() const {return requestId_;}
payload()34         inline const std::shared_ptr<std::iostream>& payload() const {return payload_;}
headerCollection()35         inline const HeaderCollection& headerCollection() const {return headerCollection_;}
responseCode()36         inline int responseCode() const {return responseCode_;}
37 
setRequestId(const std::string & requestId)38         void setRequestId(const std::string& requestId) {requestId_ = requestId;}
setPlayload(const std::shared_ptr<std::iostream> & payload)39         void setPlayload(const std::shared_ptr<std::iostream>& payload) {payload_ = payload;}
setHeaderCollection(const HeaderCollection & values)40         void setHeaderCollection(const HeaderCollection& values) { headerCollection_ = values;}
setResponseCode(const int code)41         void setResponseCode(const int code) { responseCode_ = code;}
42     private:
43         std::string requestId_;
44         std::shared_ptr<std::iostream> payload_;
45         HeaderCollection headerCollection_;
46         int responseCode_;
47     };
48 }
49 }
50