{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ImportExport.GetShippingLabel
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This operation generates a pre-paid UPS shipping label that you will use
-- to ship your device to AWS for processing.
module Amazonka.ImportExport.GetShippingLabel
  ( -- * Creating a Request
    GetShippingLabel (..),
    newGetShippingLabel,

    -- * Request Lenses
    getShippingLabel_street3,
    getShippingLabel_aPIVersion,
    getShippingLabel_country,
    getShippingLabel_stateOrProvince,
    getShippingLabel_postalCode,
    getShippingLabel_street2,
    getShippingLabel_name,
    getShippingLabel_company,
    getShippingLabel_phoneNumber,
    getShippingLabel_city,
    getShippingLabel_street1,
    getShippingLabel_jobIds,

    -- * Destructuring the Response
    GetShippingLabelResponse (..),
    newGetShippingLabelResponse,

    -- * Response Lenses
    getShippingLabelResponse_shippingLabelURL,
    getShippingLabelResponse_warning,
    getShippingLabelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImportExport.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetShippingLabel' smart constructor.
data GetShippingLabel = GetShippingLabel'
  { GetShippingLabel -> Maybe Text
street3 :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
aPIVersion :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
country :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
stateOrProvince :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
postalCode :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
street2 :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
company :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
city :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> Maybe Text
street1 :: Prelude.Maybe Prelude.Text,
    GetShippingLabel -> [Text]
jobIds :: [Prelude.Text]
  }
  deriving (GetShippingLabel -> GetShippingLabel -> Bool
(GetShippingLabel -> GetShippingLabel -> Bool)
-> (GetShippingLabel -> GetShippingLabel -> Bool)
-> Eq GetShippingLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetShippingLabel -> GetShippingLabel -> Bool
$c/= :: GetShippingLabel -> GetShippingLabel -> Bool
== :: GetShippingLabel -> GetShippingLabel -> Bool
$c== :: GetShippingLabel -> GetShippingLabel -> Bool
Prelude.Eq, ReadPrec [GetShippingLabel]
ReadPrec GetShippingLabel
Int -> ReadS GetShippingLabel
ReadS [GetShippingLabel]
(Int -> ReadS GetShippingLabel)
-> ReadS [GetShippingLabel]
-> ReadPrec GetShippingLabel
-> ReadPrec [GetShippingLabel]
-> Read GetShippingLabel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetShippingLabel]
$creadListPrec :: ReadPrec [GetShippingLabel]
readPrec :: ReadPrec GetShippingLabel
$creadPrec :: ReadPrec GetShippingLabel
readList :: ReadS [GetShippingLabel]
$creadList :: ReadS [GetShippingLabel]
readsPrec :: Int -> ReadS GetShippingLabel
$creadsPrec :: Int -> ReadS GetShippingLabel
Prelude.Read, Int -> GetShippingLabel -> ShowS
[GetShippingLabel] -> ShowS
GetShippingLabel -> String
(Int -> GetShippingLabel -> ShowS)
-> (GetShippingLabel -> String)
-> ([GetShippingLabel] -> ShowS)
-> Show GetShippingLabel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetShippingLabel] -> ShowS
$cshowList :: [GetShippingLabel] -> ShowS
show :: GetShippingLabel -> String
$cshow :: GetShippingLabel -> String
showsPrec :: Int -> GetShippingLabel -> ShowS
$cshowsPrec :: Int -> GetShippingLabel -> ShowS
Prelude.Show, (forall x. GetShippingLabel -> Rep GetShippingLabel x)
-> (forall x. Rep GetShippingLabel x -> GetShippingLabel)
-> Generic GetShippingLabel
forall x. Rep GetShippingLabel x -> GetShippingLabel
forall x. GetShippingLabel -> Rep GetShippingLabel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetShippingLabel x -> GetShippingLabel
$cfrom :: forall x. GetShippingLabel -> Rep GetShippingLabel x
Prelude.Generic)

-- |
-- Create a value of 'GetShippingLabel' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'street3', 'getShippingLabel_street3' - Undocumented member.
--
-- 'aPIVersion', 'getShippingLabel_aPIVersion' - Undocumented member.
--
-- 'country', 'getShippingLabel_country' - Undocumented member.
--
-- 'stateOrProvince', 'getShippingLabel_stateOrProvince' - Undocumented member.
--
-- 'postalCode', 'getShippingLabel_postalCode' - Undocumented member.
--
-- 'street2', 'getShippingLabel_street2' - Undocumented member.
--
-- 'name', 'getShippingLabel_name' - Undocumented member.
--
-- 'company', 'getShippingLabel_company' - Undocumented member.
--
-- 'phoneNumber', 'getShippingLabel_phoneNumber' - Undocumented member.
--
-- 'city', 'getShippingLabel_city' - Undocumented member.
--
-- 'street1', 'getShippingLabel_street1' - Undocumented member.
--
-- 'jobIds', 'getShippingLabel_jobIds' - Undocumented member.
newGetShippingLabel ::
  GetShippingLabel
newGetShippingLabel :: GetShippingLabel
newGetShippingLabel =
  GetShippingLabel' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> [Text]
-> GetShippingLabel
GetShippingLabel'
    { $sel:street3:GetShippingLabel' :: Maybe Text
street3 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:aPIVersion:GetShippingLabel' :: Maybe Text
aPIVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:country:GetShippingLabel' :: Maybe Text
country = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateOrProvince:GetShippingLabel' :: Maybe Text
stateOrProvince = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:postalCode:GetShippingLabel' :: Maybe Text
postalCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:street2:GetShippingLabel' :: Maybe Text
street2 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetShippingLabel' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:company:GetShippingLabel' :: Maybe Text
company = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumber:GetShippingLabel' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:city:GetShippingLabel' :: Maybe Text
city = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:street1:GetShippingLabel' :: Maybe Text
street1 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobIds:GetShippingLabel' :: [Text]
jobIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Undocumented member.
getShippingLabel_street3 :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_street3 :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_street3 = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
street3 :: Maybe Text
$sel:street3:GetShippingLabel' :: GetShippingLabel -> Maybe Text
street3} -> Maybe Text
street3) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:street3:GetShippingLabel' :: Maybe Text
street3 = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_aPIVersion :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_aPIVersion :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_aPIVersion = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
aPIVersion :: Maybe Text
$sel:aPIVersion:GetShippingLabel' :: GetShippingLabel -> Maybe Text
aPIVersion} -> Maybe Text
aPIVersion) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:aPIVersion:GetShippingLabel' :: Maybe Text
aPIVersion = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_country :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_country :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_country = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
country :: Maybe Text
$sel:country:GetShippingLabel' :: GetShippingLabel -> Maybe Text
country} -> Maybe Text
country) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:country:GetShippingLabel' :: Maybe Text
country = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_stateOrProvince :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_stateOrProvince :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_stateOrProvince = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
stateOrProvince :: Maybe Text
$sel:stateOrProvince:GetShippingLabel' :: GetShippingLabel -> Maybe Text
stateOrProvince} -> Maybe Text
stateOrProvince) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:stateOrProvince:GetShippingLabel' :: Maybe Text
stateOrProvince = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_postalCode :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_postalCode :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_postalCode = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
postalCode :: Maybe Text
$sel:postalCode:GetShippingLabel' :: GetShippingLabel -> Maybe Text
postalCode} -> Maybe Text
postalCode) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:postalCode:GetShippingLabel' :: Maybe Text
postalCode = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_street2 :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_street2 :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_street2 = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
street2 :: Maybe Text
$sel:street2:GetShippingLabel' :: GetShippingLabel -> Maybe Text
street2} -> Maybe Text
street2) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:street2:GetShippingLabel' :: Maybe Text
street2 = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_name :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_name :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_name = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
name :: Maybe Text
$sel:name:GetShippingLabel' :: GetShippingLabel -> Maybe Text
name} -> Maybe Text
name) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:name:GetShippingLabel' :: Maybe Text
name = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_company :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_company :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_company = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
company :: Maybe Text
$sel:company:GetShippingLabel' :: GetShippingLabel -> Maybe Text
company} -> Maybe Text
company) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:company:GetShippingLabel' :: Maybe Text
company = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_phoneNumber :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_phoneNumber :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_phoneNumber = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:GetShippingLabel' :: GetShippingLabel -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:phoneNumber:GetShippingLabel' :: Maybe Text
phoneNumber = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_city :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_city :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_city = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
city :: Maybe Text
$sel:city:GetShippingLabel' :: GetShippingLabel -> Maybe Text
city} -> Maybe Text
city) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:city:GetShippingLabel' :: Maybe Text
city = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_street1 :: Lens.Lens' GetShippingLabel (Prelude.Maybe Prelude.Text)
getShippingLabel_street1 :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabel -> f GetShippingLabel
getShippingLabel_street1 = (GetShippingLabel -> Maybe Text)
-> (GetShippingLabel -> Maybe Text -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {Maybe Text
street1 :: Maybe Text
$sel:street1:GetShippingLabel' :: GetShippingLabel -> Maybe Text
street1} -> Maybe Text
street1) (\s :: GetShippingLabel
s@GetShippingLabel' {} Maybe Text
a -> GetShippingLabel
s {$sel:street1:GetShippingLabel' :: Maybe Text
street1 = Maybe Text
a} :: GetShippingLabel)

-- | Undocumented member.
getShippingLabel_jobIds :: Lens.Lens' GetShippingLabel [Prelude.Text]
getShippingLabel_jobIds :: ([Text] -> f [Text]) -> GetShippingLabel -> f GetShippingLabel
getShippingLabel_jobIds = (GetShippingLabel -> [Text])
-> (GetShippingLabel -> [Text] -> GetShippingLabel)
-> Lens GetShippingLabel GetShippingLabel [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabel' {[Text]
jobIds :: [Text]
$sel:jobIds:GetShippingLabel' :: GetShippingLabel -> [Text]
jobIds} -> [Text]
jobIds) (\s :: GetShippingLabel
s@GetShippingLabel' {} [Text]
a -> GetShippingLabel
s {$sel:jobIds:GetShippingLabel' :: [Text]
jobIds = [Text]
a} :: GetShippingLabel) (([Text] -> f [Text]) -> GetShippingLabel -> f GetShippingLabel)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetShippingLabel
-> f GetShippingLabel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetShippingLabel where
  type
    AWSResponse GetShippingLabel =
      GetShippingLabelResponse
  request :: GetShippingLabel -> Request GetShippingLabel
request = Service -> GetShippingLabel -> Request GetShippingLabel
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy GetShippingLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetShippingLabel)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetShippingLabel))
-> Logger
-> Service
-> Proxy GetShippingLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetShippingLabel)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"GetShippingLabelResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe Text -> Int -> GetShippingLabelResponse
GetShippingLabelResponse'
            (Maybe Text -> Maybe Text -> Int -> GetShippingLabelResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetShippingLabelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ShippingLabelURL")
            Either String (Maybe Text -> Int -> GetShippingLabelResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetShippingLabelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Warning")
            Either String (Int -> GetShippingLabelResponse)
-> Either String Int -> Either String GetShippingLabelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetShippingLabel

instance Prelude.NFData GetShippingLabel

instance Core.ToHeaders GetShippingLabel where
  toHeaders :: GetShippingLabel -> ResponseHeaders
toHeaders = ResponseHeaders -> GetShippingLabel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath GetShippingLabel where
  toPath :: GetShippingLabel -> ByteString
toPath = ByteString -> GetShippingLabel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetShippingLabel where
  toQuery :: GetShippingLabel -> QueryString
toQuery GetShippingLabel' {[Text]
Maybe Text
jobIds :: [Text]
street1 :: Maybe Text
city :: Maybe Text
phoneNumber :: Maybe Text
company :: Maybe Text
name :: Maybe Text
street2 :: Maybe Text
postalCode :: Maybe Text
stateOrProvince :: Maybe Text
country :: Maybe Text
aPIVersion :: Maybe Text
street3 :: Maybe Text
$sel:jobIds:GetShippingLabel' :: GetShippingLabel -> [Text]
$sel:street1:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:city:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:phoneNumber:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:company:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:name:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:street2:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:postalCode:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:stateOrProvince:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:country:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:aPIVersion:GetShippingLabel' :: GetShippingLabel -> Maybe Text
$sel:street3:GetShippingLabel' :: GetShippingLabel -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ QueryString
"Operation=GetShippingLabel",
        ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"GetShippingLabel" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-06-01" :: Prelude.ByteString),
        ByteString
"street3" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
street3,
        ByteString
"APIVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
aPIVersion,
        ByteString
"country" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
country,
        ByteString
"stateOrProvince" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stateOrProvince,
        ByteString
"postalCode" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
postalCode,
        ByteString
"street2" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
street2,
        ByteString
"name" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
name,
        ByteString
"company" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
company,
        ByteString
"phoneNumber" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
phoneNumber,
        ByteString
"city" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
city,
        ByteString
"street1" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
street1,
        ByteString
"jobIds" ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
jobIds
      ]

-- | /See:/ 'newGetShippingLabelResponse' smart constructor.
data GetShippingLabelResponse = GetShippingLabelResponse'
  { GetShippingLabelResponse -> Maybe Text
shippingLabelURL :: Prelude.Maybe Prelude.Text,
    GetShippingLabelResponse -> Maybe Text
warning :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetShippingLabelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetShippingLabelResponse -> GetShippingLabelResponse -> Bool
(GetShippingLabelResponse -> GetShippingLabelResponse -> Bool)
-> (GetShippingLabelResponse -> GetShippingLabelResponse -> Bool)
-> Eq GetShippingLabelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetShippingLabelResponse -> GetShippingLabelResponse -> Bool
$c/= :: GetShippingLabelResponse -> GetShippingLabelResponse -> Bool
== :: GetShippingLabelResponse -> GetShippingLabelResponse -> Bool
$c== :: GetShippingLabelResponse -> GetShippingLabelResponse -> Bool
Prelude.Eq, ReadPrec [GetShippingLabelResponse]
ReadPrec GetShippingLabelResponse
Int -> ReadS GetShippingLabelResponse
ReadS [GetShippingLabelResponse]
(Int -> ReadS GetShippingLabelResponse)
-> ReadS [GetShippingLabelResponse]
-> ReadPrec GetShippingLabelResponse
-> ReadPrec [GetShippingLabelResponse]
-> Read GetShippingLabelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetShippingLabelResponse]
$creadListPrec :: ReadPrec [GetShippingLabelResponse]
readPrec :: ReadPrec GetShippingLabelResponse
$creadPrec :: ReadPrec GetShippingLabelResponse
readList :: ReadS [GetShippingLabelResponse]
$creadList :: ReadS [GetShippingLabelResponse]
readsPrec :: Int -> ReadS GetShippingLabelResponse
$creadsPrec :: Int -> ReadS GetShippingLabelResponse
Prelude.Read, Int -> GetShippingLabelResponse -> ShowS
[GetShippingLabelResponse] -> ShowS
GetShippingLabelResponse -> String
(Int -> GetShippingLabelResponse -> ShowS)
-> (GetShippingLabelResponse -> String)
-> ([GetShippingLabelResponse] -> ShowS)
-> Show GetShippingLabelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetShippingLabelResponse] -> ShowS
$cshowList :: [GetShippingLabelResponse] -> ShowS
show :: GetShippingLabelResponse -> String
$cshow :: GetShippingLabelResponse -> String
showsPrec :: Int -> GetShippingLabelResponse -> ShowS
$cshowsPrec :: Int -> GetShippingLabelResponse -> ShowS
Prelude.Show, (forall x.
 GetShippingLabelResponse -> Rep GetShippingLabelResponse x)
-> (forall x.
    Rep GetShippingLabelResponse x -> GetShippingLabelResponse)
-> Generic GetShippingLabelResponse
forall x.
Rep GetShippingLabelResponse x -> GetShippingLabelResponse
forall x.
GetShippingLabelResponse -> Rep GetShippingLabelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetShippingLabelResponse x -> GetShippingLabelResponse
$cfrom :: forall x.
GetShippingLabelResponse -> Rep GetShippingLabelResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetShippingLabelResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'shippingLabelURL', 'getShippingLabelResponse_shippingLabelURL' - Undocumented member.
--
-- 'warning', 'getShippingLabelResponse_warning' - Undocumented member.
--
-- 'httpStatus', 'getShippingLabelResponse_httpStatus' - The response's http status code.
newGetShippingLabelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetShippingLabelResponse
newGetShippingLabelResponse :: Int -> GetShippingLabelResponse
newGetShippingLabelResponse Int
pHttpStatus_ =
  GetShippingLabelResponse' :: Maybe Text -> Maybe Text -> Int -> GetShippingLabelResponse
GetShippingLabelResponse'
    { $sel:shippingLabelURL:GetShippingLabelResponse' :: Maybe Text
shippingLabelURL =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:warning:GetShippingLabelResponse' :: Maybe Text
warning = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetShippingLabelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
getShippingLabelResponse_shippingLabelURL :: Lens.Lens' GetShippingLabelResponse (Prelude.Maybe Prelude.Text)
getShippingLabelResponse_shippingLabelURL :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabelResponse -> f GetShippingLabelResponse
getShippingLabelResponse_shippingLabelURL = (GetShippingLabelResponse -> Maybe Text)
-> (GetShippingLabelResponse
    -> Maybe Text -> GetShippingLabelResponse)
-> Lens
     GetShippingLabelResponse
     GetShippingLabelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabelResponse' {Maybe Text
shippingLabelURL :: Maybe Text
$sel:shippingLabelURL:GetShippingLabelResponse' :: GetShippingLabelResponse -> Maybe Text
shippingLabelURL} -> Maybe Text
shippingLabelURL) (\s :: GetShippingLabelResponse
s@GetShippingLabelResponse' {} Maybe Text
a -> GetShippingLabelResponse
s {$sel:shippingLabelURL:GetShippingLabelResponse' :: Maybe Text
shippingLabelURL = Maybe Text
a} :: GetShippingLabelResponse)

-- | Undocumented member.
getShippingLabelResponse_warning :: Lens.Lens' GetShippingLabelResponse (Prelude.Maybe Prelude.Text)
getShippingLabelResponse_warning :: (Maybe Text -> f (Maybe Text))
-> GetShippingLabelResponse -> f GetShippingLabelResponse
getShippingLabelResponse_warning = (GetShippingLabelResponse -> Maybe Text)
-> (GetShippingLabelResponse
    -> Maybe Text -> GetShippingLabelResponse)
-> Lens
     GetShippingLabelResponse
     GetShippingLabelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabelResponse' {Maybe Text
warning :: Maybe Text
$sel:warning:GetShippingLabelResponse' :: GetShippingLabelResponse -> Maybe Text
warning} -> Maybe Text
warning) (\s :: GetShippingLabelResponse
s@GetShippingLabelResponse' {} Maybe Text
a -> GetShippingLabelResponse
s {$sel:warning:GetShippingLabelResponse' :: Maybe Text
warning = Maybe Text
a} :: GetShippingLabelResponse)

-- | The response's http status code.
getShippingLabelResponse_httpStatus :: Lens.Lens' GetShippingLabelResponse Prelude.Int
getShippingLabelResponse_httpStatus :: (Int -> f Int)
-> GetShippingLabelResponse -> f GetShippingLabelResponse
getShippingLabelResponse_httpStatus = (GetShippingLabelResponse -> Int)
-> (GetShippingLabelResponse -> Int -> GetShippingLabelResponse)
-> Lens GetShippingLabelResponse GetShippingLabelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetShippingLabelResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetShippingLabelResponse' :: GetShippingLabelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetShippingLabelResponse
s@GetShippingLabelResponse' {} Int
a -> GetShippingLabelResponse
s {$sel:httpStatus:GetShippingLabelResponse' :: Int
httpStatus = Int
a} :: GetShippingLabelResponse)

instance Prelude.NFData GetShippingLabelResponse