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 #include <alibabacloud/oss/model/CreateSymlinkRequest.h>
18 #include <alibabacloud/oss/http/HttpType.h>
19 #include "utils/Utils.h"
20
21 using namespace AlibabaCloud::OSS;
22
CreateSymlinkRequest(const std::string & bucket,const std::string & key)23 CreateSymlinkRequest::CreateSymlinkRequest(const std::string &bucket, const std::string &key):
24 OssObjectRequest(bucket, key)
25 {
26 }
27
CreateSymlinkRequest(const std::string & bucket,const std::string & key,const ObjectMetaData & metaData)28 CreateSymlinkRequest::CreateSymlinkRequest(const std::string &bucket, const std::string &key,
29 const ObjectMetaData &metaData):
30 OssObjectRequest(bucket, key),
31 metaData_(metaData)
32 {
33 }
34
SetSymlinkTarget(const std::string & value)35 void CreateSymlinkRequest::SetSymlinkTarget(const std::string& value)
36 {
37 metaData_.addHeader("x-oss-symlink-target", value);
38 }
39
setTagging(const std::string & value)40 void CreateSymlinkRequest::setTagging(const std::string& value)
41 {
42 metaData_.addHeader("x-oss-tagging", value);
43 }
44
specialHeaders() const45 HeaderCollection CreateSymlinkRequest::specialHeaders() const
46 {
47 auto headers = metaData_.toHeaderCollection();
48 auto baseHeaders = OssObjectRequest::specialHeaders();
49 headers.insert(baseHeaders.begin(), baseHeaders.end());
50 return headers;
51 }
52
53
specialParameters() const54 ParameterCollection CreateSymlinkRequest::specialParameters() const
55 {
56 ParameterCollection paramters;
57 paramters["symlink"] = "";
58 return paramters;
59 }
60
61
62