{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.EC2.Types.ReservedInstancesListing -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.EC2.Types.ReservedInstancesListing where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.EC2.Internal import Amazonka.EC2.Types.InstanceCount import Amazonka.EC2.Types.ListingStatus import Amazonka.EC2.Types.PriceSchedule import Amazonka.EC2.Types.Tag import qualified Amazonka.Prelude as Prelude -- | Describes a Reserved Instance listing. -- -- /See:/ 'newReservedInstancesListing' smart constructor. data ReservedInstancesListing = ReservedInstancesListing' { -- | A unique, case-sensitive key supplied by the client to ensure that the -- request is idempotent. For more information, see -- . clientToken :: Prelude.Maybe Prelude.Text, -- | The time the listing was created. createDate :: Prelude.Maybe Data.ISO8601, -- | The number of instances in this state. instanceCounts :: Prelude.Maybe [InstanceCount], -- | The price of the Reserved Instance listing. priceSchedules :: Prelude.Maybe [PriceSchedule], -- | The ID of the Reserved Instance. reservedInstancesId :: Prelude.Maybe Prelude.Text, -- | The ID of the Reserved Instance listing. reservedInstancesListingId :: Prelude.Maybe Prelude.Text, -- | The status of the Reserved Instance listing. status :: Prelude.Maybe ListingStatus, -- | The reason for the current status of the Reserved Instance listing. The -- response can be blank. statusMessage :: Prelude.Maybe Prelude.Text, -- | Any tags assigned to the resource. tags :: Prelude.Maybe [Tag], -- | The last modified timestamp of the listing. updateDate :: Prelude.Maybe Data.ISO8601 } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ReservedInstancesListing' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'clientToken', 'reservedInstancesListing_clientToken' - A unique, case-sensitive key supplied by the client to ensure that the -- request is idempotent. For more information, see -- . -- -- 'createDate', 'reservedInstancesListing_createDate' - The time the listing was created. -- -- 'instanceCounts', 'reservedInstancesListing_instanceCounts' - The number of instances in this state. -- -- 'priceSchedules', 'reservedInstancesListing_priceSchedules' - The price of the Reserved Instance listing. -- -- 'reservedInstancesId', 'reservedInstancesListing_reservedInstancesId' - The ID of the Reserved Instance. -- -- 'reservedInstancesListingId', 'reservedInstancesListing_reservedInstancesListingId' - The ID of the Reserved Instance listing. -- -- 'status', 'reservedInstancesListing_status' - The status of the Reserved Instance listing. -- -- 'statusMessage', 'reservedInstancesListing_statusMessage' - The reason for the current status of the Reserved Instance listing. The -- response can be blank. -- -- 'tags', 'reservedInstancesListing_tags' - Any tags assigned to the resource. -- -- 'updateDate', 'reservedInstancesListing_updateDate' - The last modified timestamp of the listing. newReservedInstancesListing :: ReservedInstancesListing newReservedInstancesListing = ReservedInstancesListing' { clientToken = Prelude.Nothing, createDate = Prelude.Nothing, instanceCounts = Prelude.Nothing, priceSchedules = Prelude.Nothing, reservedInstancesId = Prelude.Nothing, reservedInstancesListingId = Prelude.Nothing, status = Prelude.Nothing, statusMessage = Prelude.Nothing, tags = Prelude.Nothing, updateDate = Prelude.Nothing } -- | A unique, case-sensitive key supplied by the client to ensure that the -- request is idempotent. For more information, see -- . reservedInstancesListing_clientToken :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.Text) reservedInstancesListing_clientToken = Lens.lens (\ReservedInstancesListing' {clientToken} -> clientToken) (\s@ReservedInstancesListing' {} a -> s {clientToken = a} :: ReservedInstancesListing) -- | The time the listing was created. reservedInstancesListing_createDate :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.UTCTime) reservedInstancesListing_createDate = Lens.lens (\ReservedInstancesListing' {createDate} -> createDate) (\s@ReservedInstancesListing' {} a -> s {createDate = a} :: ReservedInstancesListing) Prelude.. Lens.mapping Data._Time -- | The number of instances in this state. reservedInstancesListing_instanceCounts :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe [InstanceCount]) reservedInstancesListing_instanceCounts = Lens.lens (\ReservedInstancesListing' {instanceCounts} -> instanceCounts) (\s@ReservedInstancesListing' {} a -> s {instanceCounts = a} :: ReservedInstancesListing) Prelude.. Lens.mapping Lens.coerced -- | The price of the Reserved Instance listing. reservedInstancesListing_priceSchedules :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe [PriceSchedule]) reservedInstancesListing_priceSchedules = Lens.lens (\ReservedInstancesListing' {priceSchedules} -> priceSchedules) (\s@ReservedInstancesListing' {} a -> s {priceSchedules = a} :: ReservedInstancesListing) Prelude.. Lens.mapping Lens.coerced -- | The ID of the Reserved Instance. reservedInstancesListing_reservedInstancesId :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.Text) reservedInstancesListing_reservedInstancesId = Lens.lens (\ReservedInstancesListing' {reservedInstancesId} -> reservedInstancesId) (\s@ReservedInstancesListing' {} a -> s {reservedInstancesId = a} :: ReservedInstancesListing) -- | The ID of the Reserved Instance listing. reservedInstancesListing_reservedInstancesListingId :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.Text) reservedInstancesListing_reservedInstancesListingId = Lens.lens (\ReservedInstancesListing' {reservedInstancesListingId} -> reservedInstancesListingId) (\s@ReservedInstancesListing' {} a -> s {reservedInstancesListingId = a} :: ReservedInstancesListing) -- | The status of the Reserved Instance listing. reservedInstancesListing_status :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe ListingStatus) reservedInstancesListing_status = Lens.lens (\ReservedInstancesListing' {status} -> status) (\s@ReservedInstancesListing' {} a -> s {status = a} :: ReservedInstancesListing) -- | The reason for the current status of the Reserved Instance listing. The -- response can be blank. reservedInstancesListing_statusMessage :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.Text) reservedInstancesListing_statusMessage = Lens.lens (\ReservedInstancesListing' {statusMessage} -> statusMessage) (\s@ReservedInstancesListing' {} a -> s {statusMessage = a} :: ReservedInstancesListing) -- | Any tags assigned to the resource. reservedInstancesListing_tags :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe [Tag]) reservedInstancesListing_tags = Lens.lens (\ReservedInstancesListing' {tags} -> tags) (\s@ReservedInstancesListing' {} a -> s {tags = a} :: ReservedInstancesListing) Prelude.. Lens.mapping Lens.coerced -- | The last modified timestamp of the listing. reservedInstancesListing_updateDate :: Lens.Lens' ReservedInstancesListing (Prelude.Maybe Prelude.UTCTime) reservedInstancesListing_updateDate = Lens.lens (\ReservedInstancesListing' {updateDate} -> updateDate) (\s@ReservedInstancesListing' {} a -> s {updateDate = a} :: ReservedInstancesListing) Prelude.. Lens.mapping Data._Time instance Data.FromXML ReservedInstancesListing where parseXML x = ReservedInstancesListing' Prelude.<$> (x Data..@? "clientToken") Prelude.<*> (x Data..@? "createDate") Prelude.<*> ( x Data..@? "instanceCounts" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> ( x Data..@? "priceSchedules" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "reservedInstancesId") Prelude.<*> (x Data..@? "reservedInstancesListingId") Prelude.<*> (x Data..@? "status") Prelude.<*> (x Data..@? "statusMessage") Prelude.<*> ( x Data..@? "tagSet" Core..!@ Prelude.mempty Prelude.>>= Core.may (Data.parseXMLList "item") ) Prelude.<*> (x Data..@? "updateDate") instance Prelude.Hashable ReservedInstancesListing where hashWithSalt _salt ReservedInstancesListing' {..} = _salt `Prelude.hashWithSalt` clientToken `Prelude.hashWithSalt` createDate `Prelude.hashWithSalt` instanceCounts `Prelude.hashWithSalt` priceSchedules `Prelude.hashWithSalt` reservedInstancesId `Prelude.hashWithSalt` reservedInstancesListingId `Prelude.hashWithSalt` status `Prelude.hashWithSalt` statusMessage `Prelude.hashWithSalt` tags `Prelude.hashWithSalt` updateDate instance Prelude.NFData ReservedInstancesListing where rnf ReservedInstancesListing' {..} = Prelude.rnf clientToken `Prelude.seq` Prelude.rnf createDate `Prelude.seq` Prelude.rnf instanceCounts `Prelude.seq` Prelude.rnf priceSchedules `Prelude.seq` Prelude.rnf reservedInstancesId `Prelude.seq` Prelude.rnf reservedInstancesListingId `Prelude.seq` Prelude.rnf status `Prelude.seq` Prelude.rnf statusMessage `Prelude.seq` Prelude.rnf tags `Prelude.seq` Prelude.rnf updateDate