AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
UrlRequest.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. 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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKASSETSINTERFACES_URLREQUEST_H_
17 #define ACSDKASSETSINTERFACES_URLREQUEST_H_
18 
19 #include "ArtifactRequest.h"
20 
21 namespace alexaClientSDK {
22 namespace acsdkAssets {
23 namespace commonInterfaces {
24 
25 class UrlRequest : public ArtifactRequest {
26 public:
36  static std::shared_ptr<UrlRequest> create(
37  std::string url,
38  std::string filename,
39  bool unpack = false,
40  std::string certPath = "");
41 
45  const std::string& getUrl() const;
46 
50  const std::string& getFilename() const;
51 
55  const std::string& getCertPath() const;
56 
59  Type getRequestType() const override;
60  bool needsUnpacking() const override;
61  std::string getSummary() const override;
62  std::string toJsonString() const override;
64 
65 private:
66  UrlRequest(std::string url, std::string filename, bool unpack, std::string certPath);
67 
68 private:
69  const std::string m_url;
70  const std::string m_filename;
71  const bool m_unpack;
72  std::string m_summary;
73  const std::string m_certPath;
74  std::string m_certHash;
75 };
76 
77 inline const std::string& UrlRequest::getUrl() const {
78  return m_url;
79 }
80 
81 inline const std::string& UrlRequest::getFilename() const {
82  return m_filename;
83 }
84 
85 inline const std::string& UrlRequest::getCertPath() const {
86  return m_certPath;
87 }
88 
90  return Type::URL;
91 }
92 
93 inline bool UrlRequest::needsUnpacking() const {
94  return m_unpack;
95 }
96 
98  return m_summary;
99 }
100 
101 } // namespace commonInterfaces
102 } // namespace acsdkAssets
103 } // namespace alexaClientSDK
104 
105 #endif // ACSDKASSETSINTERFACES_URLREQUEST_H_
const std::string & getUrl() const
Definition: UrlRequest.h:77
::std::string string
Definition: gtest-port.h:1097
std::string getSummary() const override
Definition: UrlRequest.h:97
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Type getRequestType() const override
Definition: UrlRequest.h:89
const std::string & getCertPath() const
Definition: UrlRequest.h:85
static std::shared_ptr< UrlRequest > create(std::string url, std::string filename, bool unpack=false, std::string certPath="")
const std::string & getFilename() const
Definition: UrlRequest.h:81
bool needsUnpacking() const override
Definition: UrlRequest.h:93

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0