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 
18 #include <alibabacloud/oss/model/ProcessObjectRequest.h>
19 #include <sstream>
20 using namespace AlibabaCloud::OSS;
21 
ProcessObjectRequest(const std::string & bucket,const std::string & key)22 ProcessObjectRequest::ProcessObjectRequest(const std::string &bucket, const std::string &key):
23     ProcessObjectRequest(bucket, key, "")
24 {
25 }
26 
ProcessObjectRequest(const std::string & bucket,const std::string & key,const std::string & process)27 ProcessObjectRequest::ProcessObjectRequest(const std::string &bucket, const std::string &key, const std::string &process) :
28     OssObjectRequest(bucket, key),
29     process_(process)
30 {
31     setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);
32 }
33 
34 
setProcess(const std::string & process)35 void ProcessObjectRequest::setProcess(const std::string &process)
36 {
37     process_ = process;
38 }
39 
specialParameters() const40 ParameterCollection ProcessObjectRequest::specialParameters() const
41 {
42     auto parameters = OssObjectRequest::specialParameters();
43     parameters["x-oss-process"];
44     return parameters;
45 }
46 
payload() const47 std::string  ProcessObjectRequest::payload() const
48 {
49     std::stringstream ss;
50     ss << "x-oss-process=" << process_;
51     return ss.str();
52 }
53 
54 
55