1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/iam/IAM_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h> 9 #include <aws/core/utils/DateTime.h> 10 #include <aws/core/utils/memory/stl/AWSString.h> 11 #include <utility> 12 13 namespace Aws 14 { 15 namespace Utils 16 { 17 namespace Xml 18 { 19 class XmlNode; 20 } // namespace Xml 21 } // namespace Utils 22 namespace IAM 23 { 24 namespace Model 25 { 26 27 /** 28 * <p>Contains information about the last time that an IAM role was used. This 29 * includes the date and time and the Region in which the role was last used. 30 * Activity is only reported for the trailing 400 days. This period can be shorter 31 * if your Region began supporting these features within the last year. The role 32 * might have been used more than 400 days ago. For more information, see <a 33 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 34 * where data is tracked</a> in the <i>IAM User Guide</i>.</p> <p>This data type is 35 * returned as a response element in the <a>GetRole</a> and 36 * <a>GetAccountAuthorizationDetails</a> operations.</p><p><h3>See Also:</h3> <a 37 * href="http://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/RoleLastUsed">AWS 38 * API Reference</a></p> 39 */ 40 class AWS_IAM_API RoleLastUsed 41 { 42 public: 43 RoleLastUsed(); 44 RoleLastUsed(const Aws::Utils::Xml::XmlNode& xmlNode); 45 RoleLastUsed& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 46 47 void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; 48 void OutputToStream(Aws::OStream& oStream, const char* location) const; 49 50 51 /** 52 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 53 * date-time format</a> that the role was last used.</p> <p>This field is null if 54 * the role has not been used within the IAM tracking period. For more information 55 * about the tracking period, see <a 56 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 57 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 58 */ GetLastUsedDate()59 inline const Aws::Utils::DateTime& GetLastUsedDate() const{ return m_lastUsedDate; } 60 61 /** 62 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 63 * date-time format</a> that the role was last used.</p> <p>This field is null if 64 * the role has not been used within the IAM tracking period. For more information 65 * about the tracking period, see <a 66 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 67 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 68 */ LastUsedDateHasBeenSet()69 inline bool LastUsedDateHasBeenSet() const { return m_lastUsedDateHasBeenSet; } 70 71 /** 72 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 73 * date-time format</a> that the role was last used.</p> <p>This field is null if 74 * the role has not been used within the IAM tracking period. For more information 75 * about the tracking period, see <a 76 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 77 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 78 */ SetLastUsedDate(const Aws::Utils::DateTime & value)79 inline void SetLastUsedDate(const Aws::Utils::DateTime& value) { m_lastUsedDateHasBeenSet = true; m_lastUsedDate = value; } 80 81 /** 82 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 83 * date-time format</a> that the role was last used.</p> <p>This field is null if 84 * the role has not been used within the IAM tracking period. For more information 85 * about the tracking period, see <a 86 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 87 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 88 */ SetLastUsedDate(Aws::Utils::DateTime && value)89 inline void SetLastUsedDate(Aws::Utils::DateTime&& value) { m_lastUsedDateHasBeenSet = true; m_lastUsedDate = std::move(value); } 90 91 /** 92 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 93 * date-time format</a> that the role was last used.</p> <p>This field is null if 94 * the role has not been used within the IAM tracking period. For more information 95 * about the tracking period, see <a 96 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 97 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 98 */ WithLastUsedDate(const Aws::Utils::DateTime & value)99 inline RoleLastUsed& WithLastUsedDate(const Aws::Utils::DateTime& value) { SetLastUsedDate(value); return *this;} 100 101 /** 102 * <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 103 * date-time format</a> that the role was last used.</p> <p>This field is null if 104 * the role has not been used within the IAM tracking period. For more information 105 * about the tracking period, see <a 106 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period">Regions 107 * where data is tracked</a> in the <i>IAM User Guide</i>. </p> 108 */ WithLastUsedDate(Aws::Utils::DateTime && value)109 inline RoleLastUsed& WithLastUsedDate(Aws::Utils::DateTime&& value) { SetLastUsedDate(std::move(value)); return *this;} 110 111 112 /** 113 * <p>The name of the Amazon Web Services Region in which the role was last 114 * used.</p> 115 */ GetRegion()116 inline const Aws::String& GetRegion() const{ return m_region; } 117 118 /** 119 * <p>The name of the Amazon Web Services Region in which the role was last 120 * used.</p> 121 */ RegionHasBeenSet()122 inline bool RegionHasBeenSet() const { return m_regionHasBeenSet; } 123 124 /** 125 * <p>The name of the Amazon Web Services Region in which the role was last 126 * used.</p> 127 */ SetRegion(const Aws::String & value)128 inline void SetRegion(const Aws::String& value) { m_regionHasBeenSet = true; m_region = value; } 129 130 /** 131 * <p>The name of the Amazon Web Services Region in which the role was last 132 * used.</p> 133 */ SetRegion(Aws::String && value)134 inline void SetRegion(Aws::String&& value) { m_regionHasBeenSet = true; m_region = std::move(value); } 135 136 /** 137 * <p>The name of the Amazon Web Services Region in which the role was last 138 * used.</p> 139 */ SetRegion(const char * value)140 inline void SetRegion(const char* value) { m_regionHasBeenSet = true; m_region.assign(value); } 141 142 /** 143 * <p>The name of the Amazon Web Services Region in which the role was last 144 * used.</p> 145 */ WithRegion(const Aws::String & value)146 inline RoleLastUsed& WithRegion(const Aws::String& value) { SetRegion(value); return *this;} 147 148 /** 149 * <p>The name of the Amazon Web Services Region in which the role was last 150 * used.</p> 151 */ WithRegion(Aws::String && value)152 inline RoleLastUsed& WithRegion(Aws::String&& value) { SetRegion(std::move(value)); return *this;} 153 154 /** 155 * <p>The name of the Amazon Web Services Region in which the role was last 156 * used.</p> 157 */ WithRegion(const char * value)158 inline RoleLastUsed& WithRegion(const char* value) { SetRegion(value); return *this;} 159 160 private: 161 162 Aws::Utils::DateTime m_lastUsedDate; 163 bool m_lastUsedDateHasBeenSet; 164 165 Aws::String m_region; 166 bool m_regionHasBeenSet; 167 }; 168 169 } // namespace Model 170 } // namespace IAM 171 } // namespace Aws 172