AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
VendableArtifact.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_VENDABLEARTIFACT_H_
17 #define ACSDKASSETSINTERFACES_VENDABLEARTIFACT_H_
18 
19 #include <chrono>
20 
21 #include "DavsRequest.h"
22 
23 namespace alexaClientSDK {
24 namespace acsdkAssets {
25 namespace commonInterfaces {
26 
28 public:
29  using TimeEpoch = std::chrono::system_clock::time_point;
30 
44  static std::unique_ptr<VendableArtifact> create(
45  std::shared_ptr<DavsRequest> request,
46  std::string id,
47  size_t artifactSizeBytes,
48  TimeEpoch artifactExpiry,
49  std::string s3Url,
50  TimeEpoch urlExpiry,
51  size_t currentSizeBytes,
52  bool multipart);
53 
62  static std::unique_ptr<VendableArtifact> create(
63  std::shared_ptr<DavsRequest> request,
64  const std::string& jsonString,
65  const bool isMultipart = false);
66 
67  inline const std::shared_ptr<DavsRequest>& getRequest() const {
68  return m_request;
69  }
70 
71  inline const std::string& getId() const {
72  return m_id;
73  }
74 
75  inline const std::string& getS3Url() const {
76  return m_s3Url;
77  }
78 
79  inline size_t getArtifactSizeBytes() const {
80  return m_artifactSizeBytes;
81  }
82 
83  inline const TimeEpoch& getArtifactExpiry() const {
84  return m_artifactExpiry;
85  }
86 
87  inline const TimeEpoch& getUrlExpiry() const {
88  return m_urlExpiry;
89  }
90 
91  inline size_t getCurrentSizeBytes() const {
92  return m_currentSizeBytes;
93  }
94 
95  inline const std::string& getUniqueIdentifier() const {
96  return m_uuid;
97  }
98 
99  inline bool isMultipart() const {
100  return m_multipart;
101  }
102 
103 private:
105  std::shared_ptr<DavsRequest> request,
106  std::string id,
107  size_t artifactSizeBytes,
108  TimeEpoch artifactExpiry,
109  std::string s3Url,
110  TimeEpoch urlExpiry,
111  size_t currentSizeBytes,
112  std::string uuid,
113  bool multipart);
114 
115 private:
116  const std::shared_ptr<DavsRequest> m_request;
117  const std::string m_id;
118  const size_t m_artifactSizeBytes;
119  const TimeEpoch m_artifactExpiry;
120  const std::string m_s3Url;
121  const TimeEpoch m_urlExpiry;
122  const size_t m_currentSizeBytes;
123  const std::string m_uuid;
124  const bool m_multipart;
125 };
126 
127 } // namespace commonInterfaces
128 } // namespace acsdkAssets
129 } // namespace alexaClientSDK
130 
131 #endif // ACSDKASSETSINTERFACES_VENDABLEARTIFACT_H_
size_t getArtifactSizeBytes() const
Definition: VendableArtifact.h:79
const std::shared_ptr< DavsRequest > & getRequest() const
Definition: VendableArtifact.h:67
const std::string & getS3Url() const
Definition: VendableArtifact.h:75
const std::string & getUniqueIdentifier() const
Definition: VendableArtifact.h:95
::std::string string
Definition: gtest-port.h:1097
size_t getCurrentSizeBytes() const
Definition: VendableArtifact.h:91
std::chrono::system_clock::time_point TimeEpoch
Definition: VendableArtifact.h:29
bool isMultipart() const
Definition: VendableArtifact.h:99
const std::string & getId() const
Definition: VendableArtifact.h:71
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
const TimeEpoch & getArtifactExpiry() const
Definition: VendableArtifact.h:83
static std::unique_ptr< VendableArtifact > create(std::shared_ptr< DavsRequest > request, std::string id, size_t artifactSizeBytes, TimeEpoch artifactExpiry, std::string s3Url, TimeEpoch urlExpiry, size_t currentSizeBytes, bool multipart)
const TimeEpoch & getUrlExpiry() const
Definition: VendableArtifact.h:87

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