{-# 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.Lightsail.UpdateContainerService
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the configuration of your Amazon Lightsail container service,
-- such as its power, scale, and public domain names.
module Amazonka.Lightsail.UpdateContainerService
  ( -- * Creating a Request
    UpdateContainerService (..),
    newUpdateContainerService,

    -- * Request Lenses
    updateContainerService_isDisabled,
    updateContainerService_power,
    updateContainerService_privateRegistryAccess,
    updateContainerService_publicDomainNames,
    updateContainerService_scale,
    updateContainerService_serviceName,

    -- * Destructuring the Response
    UpdateContainerServiceResponse (..),
    newUpdateContainerServiceResponse,

    -- * Response Lenses
    updateContainerServiceResponse_containerService,
    updateContainerServiceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateContainerService' smart constructor.
data UpdateContainerService = UpdateContainerService'
  { -- | A Boolean value to indicate whether the container service is disabled.
    UpdateContainerService -> Maybe Bool
isDisabled :: Prelude.Maybe Prelude.Bool,
    -- | The power for the container service.
    --
    -- The power specifies the amount of memory, vCPUs, and base monthly cost
    -- of each node of the container service. The @power@ and @scale@ of a
    -- container service makes up its configured capacity. To determine the
    -- monthly price of your container service, multiply the base price of the
    -- @power@ with the @scale@ (the number of nodes) of the service.
    --
    -- Use the @GetContainerServicePowers@ action to view the specifications of
    -- each power option.
    UpdateContainerService -> Maybe ContainerServicePowerName
power :: Prelude.Maybe ContainerServicePowerName,
    -- | An object to describe the configuration for the container service to
    -- access private container image repositories, such as Amazon Elastic
    -- Container Registry (Amazon ECR) private repositories.
    --
    -- For more information, see
    -- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service>
    -- in the /Amazon Lightsail Developer Guide/.
    UpdateContainerService -> Maybe PrivateRegistryAccessRequest
privateRegistryAccess :: Prelude.Maybe PrivateRegistryAccessRequest,
    -- | The public domain names to use with the container service, such as
    -- @example.com@ and @www.example.com@.
    --
    -- You can specify up to four public domain names for a container service.
    -- The domain names that you specify are used when you create a deployment
    -- with a container configured as the public endpoint of your container
    -- service.
    --
    -- If you don\'t specify public domain names, then you can use the default
    -- domain of the container service.
    --
    -- You must create and validate an SSL\/TLS certificate before you can use
    -- public domain names with your container service. Use the
    -- @CreateCertificate@ action to create a certificate for the public domain
    -- names you want to use with your container service.
    --
    -- You can specify public domain names using a string to array map as shown
    -- in the example later on this page.
    UpdateContainerService -> Maybe (HashMap Text [Text])
publicDomainNames :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The scale for the container service.
    --
    -- The scale specifies the allocated compute nodes of the container
    -- service. The @power@ and @scale@ of a container service makes up its
    -- configured capacity. To determine the monthly price of your container
    -- service, multiply the base price of the @power@ with the @scale@ (the
    -- number of nodes) of the service.
    UpdateContainerService -> Maybe Natural
scale :: Prelude.Maybe Prelude.Natural,
    -- | The name of the container service to update.
    UpdateContainerService -> Text
serviceName :: Prelude.Text
  }
  deriving (UpdateContainerService -> UpdateContainerService -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateContainerService -> UpdateContainerService -> Bool
$c/= :: UpdateContainerService -> UpdateContainerService -> Bool
== :: UpdateContainerService -> UpdateContainerService -> Bool
$c== :: UpdateContainerService -> UpdateContainerService -> Bool
Prelude.Eq, ReadPrec [UpdateContainerService]
ReadPrec UpdateContainerService
Int -> ReadS UpdateContainerService
ReadS [UpdateContainerService]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateContainerService]
$creadListPrec :: ReadPrec [UpdateContainerService]
readPrec :: ReadPrec UpdateContainerService
$creadPrec :: ReadPrec UpdateContainerService
readList :: ReadS [UpdateContainerService]
$creadList :: ReadS [UpdateContainerService]
readsPrec :: Int -> ReadS UpdateContainerService
$creadsPrec :: Int -> ReadS UpdateContainerService
Prelude.Read, Int -> UpdateContainerService -> ShowS
[UpdateContainerService] -> ShowS
UpdateContainerService -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateContainerService] -> ShowS
$cshowList :: [UpdateContainerService] -> ShowS
show :: UpdateContainerService -> String
$cshow :: UpdateContainerService -> String
showsPrec :: Int -> UpdateContainerService -> ShowS
$cshowsPrec :: Int -> UpdateContainerService -> ShowS
Prelude.Show, forall x. Rep UpdateContainerService x -> UpdateContainerService
forall x. UpdateContainerService -> Rep UpdateContainerService x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateContainerService x -> UpdateContainerService
$cfrom :: forall x. UpdateContainerService -> Rep UpdateContainerService x
Prelude.Generic)

-- |
-- Create a value of 'UpdateContainerService' 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:
--
-- 'isDisabled', 'updateContainerService_isDisabled' - A Boolean value to indicate whether the container service is disabled.
--
-- 'power', 'updateContainerService_power' - The power for the container service.
--
-- The power specifies the amount of memory, vCPUs, and base monthly cost
-- of each node of the container service. The @power@ and @scale@ of a
-- container service makes up its configured capacity. To determine the
-- monthly price of your container service, multiply the base price of the
-- @power@ with the @scale@ (the number of nodes) of the service.
--
-- Use the @GetContainerServicePowers@ action to view the specifications of
-- each power option.
--
-- 'privateRegistryAccess', 'updateContainerService_privateRegistryAccess' - An object to describe the configuration for the container service to
-- access private container image repositories, such as Amazon Elastic
-- Container Registry (Amazon ECR) private repositories.
--
-- For more information, see
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service>
-- in the /Amazon Lightsail Developer Guide/.
--
-- 'publicDomainNames', 'updateContainerService_publicDomainNames' - The public domain names to use with the container service, such as
-- @example.com@ and @www.example.com@.
--
-- You can specify up to four public domain names for a container service.
-- The domain names that you specify are used when you create a deployment
-- with a container configured as the public endpoint of your container
-- service.
--
-- If you don\'t specify public domain names, then you can use the default
-- domain of the container service.
--
-- You must create and validate an SSL\/TLS certificate before you can use
-- public domain names with your container service. Use the
-- @CreateCertificate@ action to create a certificate for the public domain
-- names you want to use with your container service.
--
-- You can specify public domain names using a string to array map as shown
-- in the example later on this page.
--
-- 'scale', 'updateContainerService_scale' - The scale for the container service.
--
-- The scale specifies the allocated compute nodes of the container
-- service. The @power@ and @scale@ of a container service makes up its
-- configured capacity. To determine the monthly price of your container
-- service, multiply the base price of the @power@ with the @scale@ (the
-- number of nodes) of the service.
--
-- 'serviceName', 'updateContainerService_serviceName' - The name of the container service to update.
newUpdateContainerService ::
  -- | 'serviceName'
  Prelude.Text ->
  UpdateContainerService
newUpdateContainerService :: Text -> UpdateContainerService
newUpdateContainerService Text
pServiceName_ =
  UpdateContainerService'
    { $sel:isDisabled:UpdateContainerService' :: Maybe Bool
isDisabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:power:UpdateContainerService' :: Maybe ContainerServicePowerName
power = forall a. Maybe a
Prelude.Nothing,
      $sel:privateRegistryAccess:UpdateContainerService' :: Maybe PrivateRegistryAccessRequest
privateRegistryAccess = forall a. Maybe a
Prelude.Nothing,
      $sel:publicDomainNames:UpdateContainerService' :: Maybe (HashMap Text [Text])
publicDomainNames = forall a. Maybe a
Prelude.Nothing,
      $sel:scale:UpdateContainerService' :: Maybe Natural
scale = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceName:UpdateContainerService' :: Text
serviceName = Text
pServiceName_
    }

-- | A Boolean value to indicate whether the container service is disabled.
updateContainerService_isDisabled :: Lens.Lens' UpdateContainerService (Prelude.Maybe Prelude.Bool)
updateContainerService_isDisabled :: Lens' UpdateContainerService (Maybe Bool)
updateContainerService_isDisabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Maybe Bool
isDisabled :: Maybe Bool
$sel:isDisabled:UpdateContainerService' :: UpdateContainerService -> Maybe Bool
isDisabled} -> Maybe Bool
isDisabled) (\s :: UpdateContainerService
s@UpdateContainerService' {} Maybe Bool
a -> UpdateContainerService
s {$sel:isDisabled:UpdateContainerService' :: Maybe Bool
isDisabled = Maybe Bool
a} :: UpdateContainerService)

-- | The power for the container service.
--
-- The power specifies the amount of memory, vCPUs, and base monthly cost
-- of each node of the container service. The @power@ and @scale@ of a
-- container service makes up its configured capacity. To determine the
-- monthly price of your container service, multiply the base price of the
-- @power@ with the @scale@ (the number of nodes) of the service.
--
-- Use the @GetContainerServicePowers@ action to view the specifications of
-- each power option.
updateContainerService_power :: Lens.Lens' UpdateContainerService (Prelude.Maybe ContainerServicePowerName)
updateContainerService_power :: Lens' UpdateContainerService (Maybe ContainerServicePowerName)
updateContainerService_power = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Maybe ContainerServicePowerName
power :: Maybe ContainerServicePowerName
$sel:power:UpdateContainerService' :: UpdateContainerService -> Maybe ContainerServicePowerName
power} -> Maybe ContainerServicePowerName
power) (\s :: UpdateContainerService
s@UpdateContainerService' {} Maybe ContainerServicePowerName
a -> UpdateContainerService
s {$sel:power:UpdateContainerService' :: Maybe ContainerServicePowerName
power = Maybe ContainerServicePowerName
a} :: UpdateContainerService)

-- | An object to describe the configuration for the container service to
-- access private container image repositories, such as Amazon Elastic
-- Container Registry (Amazon ECR) private repositories.
--
-- For more information, see
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service>
-- in the /Amazon Lightsail Developer Guide/.
updateContainerService_privateRegistryAccess :: Lens.Lens' UpdateContainerService (Prelude.Maybe PrivateRegistryAccessRequest)
updateContainerService_privateRegistryAccess :: Lens' UpdateContainerService (Maybe PrivateRegistryAccessRequest)
updateContainerService_privateRegistryAccess = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Maybe PrivateRegistryAccessRequest
privateRegistryAccess :: Maybe PrivateRegistryAccessRequest
$sel:privateRegistryAccess:UpdateContainerService' :: UpdateContainerService -> Maybe PrivateRegistryAccessRequest
privateRegistryAccess} -> Maybe PrivateRegistryAccessRequest
privateRegistryAccess) (\s :: UpdateContainerService
s@UpdateContainerService' {} Maybe PrivateRegistryAccessRequest
a -> UpdateContainerService
s {$sel:privateRegistryAccess:UpdateContainerService' :: Maybe PrivateRegistryAccessRequest
privateRegistryAccess = Maybe PrivateRegistryAccessRequest
a} :: UpdateContainerService)

-- | The public domain names to use with the container service, such as
-- @example.com@ and @www.example.com@.
--
-- You can specify up to four public domain names for a container service.
-- The domain names that you specify are used when you create a deployment
-- with a container configured as the public endpoint of your container
-- service.
--
-- If you don\'t specify public domain names, then you can use the default
-- domain of the container service.
--
-- You must create and validate an SSL\/TLS certificate before you can use
-- public domain names with your container service. Use the
-- @CreateCertificate@ action to create a certificate for the public domain
-- names you want to use with your container service.
--
-- You can specify public domain names using a string to array map as shown
-- in the example later on this page.
updateContainerService_publicDomainNames :: Lens.Lens' UpdateContainerService (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
updateContainerService_publicDomainNames :: Lens' UpdateContainerService (Maybe (HashMap Text [Text]))
updateContainerService_publicDomainNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Maybe (HashMap Text [Text])
publicDomainNames :: Maybe (HashMap Text [Text])
$sel:publicDomainNames:UpdateContainerService' :: UpdateContainerService -> Maybe (HashMap Text [Text])
publicDomainNames} -> Maybe (HashMap Text [Text])
publicDomainNames) (\s :: UpdateContainerService
s@UpdateContainerService' {} Maybe (HashMap Text [Text])
a -> UpdateContainerService
s {$sel:publicDomainNames:UpdateContainerService' :: Maybe (HashMap Text [Text])
publicDomainNames = Maybe (HashMap Text [Text])
a} :: UpdateContainerService) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The scale for the container service.
--
-- The scale specifies the allocated compute nodes of the container
-- service. The @power@ and @scale@ of a container service makes up its
-- configured capacity. To determine the monthly price of your container
-- service, multiply the base price of the @power@ with the @scale@ (the
-- number of nodes) of the service.
updateContainerService_scale :: Lens.Lens' UpdateContainerService (Prelude.Maybe Prelude.Natural)
updateContainerService_scale :: Lens' UpdateContainerService (Maybe Natural)
updateContainerService_scale = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Maybe Natural
scale :: Maybe Natural
$sel:scale:UpdateContainerService' :: UpdateContainerService -> Maybe Natural
scale} -> Maybe Natural
scale) (\s :: UpdateContainerService
s@UpdateContainerService' {} Maybe Natural
a -> UpdateContainerService
s {$sel:scale:UpdateContainerService' :: Maybe Natural
scale = Maybe Natural
a} :: UpdateContainerService)

-- | The name of the container service to update.
updateContainerService_serviceName :: Lens.Lens' UpdateContainerService Prelude.Text
updateContainerService_serviceName :: Lens' UpdateContainerService Text
updateContainerService_serviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerService' {Text
serviceName :: Text
$sel:serviceName:UpdateContainerService' :: UpdateContainerService -> Text
serviceName} -> Text
serviceName) (\s :: UpdateContainerService
s@UpdateContainerService' {} Text
a -> UpdateContainerService
s {$sel:serviceName:UpdateContainerService' :: Text
serviceName = Text
a} :: UpdateContainerService)

instance Core.AWSRequest UpdateContainerService where
  type
    AWSResponse UpdateContainerService =
      UpdateContainerServiceResponse
  request :: (Service -> Service)
-> UpdateContainerService -> Request UpdateContainerService
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateContainerService
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateContainerService)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ContainerService -> Int -> UpdateContainerServiceResponse
UpdateContainerServiceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"containerService")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateContainerService where
  hashWithSalt :: Int -> UpdateContainerService -> Int
hashWithSalt Int
_salt UpdateContainerService' {Maybe Bool
Maybe Natural
Maybe (HashMap Text [Text])
Maybe ContainerServicePowerName
Maybe PrivateRegistryAccessRequest
Text
serviceName :: Text
scale :: Maybe Natural
publicDomainNames :: Maybe (HashMap Text [Text])
privateRegistryAccess :: Maybe PrivateRegistryAccessRequest
power :: Maybe ContainerServicePowerName
isDisabled :: Maybe Bool
$sel:serviceName:UpdateContainerService' :: UpdateContainerService -> Text
$sel:scale:UpdateContainerService' :: UpdateContainerService -> Maybe Natural
$sel:publicDomainNames:UpdateContainerService' :: UpdateContainerService -> Maybe (HashMap Text [Text])
$sel:privateRegistryAccess:UpdateContainerService' :: UpdateContainerService -> Maybe PrivateRegistryAccessRequest
$sel:power:UpdateContainerService' :: UpdateContainerService -> Maybe ContainerServicePowerName
$sel:isDisabled:UpdateContainerService' :: UpdateContainerService -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isDisabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContainerServicePowerName
power
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PrivateRegistryAccessRequest
privateRegistryAccess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
publicDomainNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
scale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceName

instance Prelude.NFData UpdateContainerService where
  rnf :: UpdateContainerService -> ()
rnf UpdateContainerService' {Maybe Bool
Maybe Natural
Maybe (HashMap Text [Text])
Maybe ContainerServicePowerName
Maybe PrivateRegistryAccessRequest
Text
serviceName :: Text
scale :: Maybe Natural
publicDomainNames :: Maybe (HashMap Text [Text])
privateRegistryAccess :: Maybe PrivateRegistryAccessRequest
power :: Maybe ContainerServicePowerName
isDisabled :: Maybe Bool
$sel:serviceName:UpdateContainerService' :: UpdateContainerService -> Text
$sel:scale:UpdateContainerService' :: UpdateContainerService -> Maybe Natural
$sel:publicDomainNames:UpdateContainerService' :: UpdateContainerService -> Maybe (HashMap Text [Text])
$sel:privateRegistryAccess:UpdateContainerService' :: UpdateContainerService -> Maybe PrivateRegistryAccessRequest
$sel:power:UpdateContainerService' :: UpdateContainerService -> Maybe ContainerServicePowerName
$sel:isDisabled:UpdateContainerService' :: UpdateContainerService -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isDisabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerServicePowerName
power
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PrivateRegistryAccessRequest
privateRegistryAccess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
publicDomainNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
scale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceName

instance Data.ToHeaders UpdateContainerService where
  toHeaders :: UpdateContainerService -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.UpdateContainerService" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateContainerService where
  toJSON :: UpdateContainerService -> Value
toJSON UpdateContainerService' {Maybe Bool
Maybe Natural
Maybe (HashMap Text [Text])
Maybe ContainerServicePowerName
Maybe PrivateRegistryAccessRequest
Text
serviceName :: Text
scale :: Maybe Natural
publicDomainNames :: Maybe (HashMap Text [Text])
privateRegistryAccess :: Maybe PrivateRegistryAccessRequest
power :: Maybe ContainerServicePowerName
isDisabled :: Maybe Bool
$sel:serviceName:UpdateContainerService' :: UpdateContainerService -> Text
$sel:scale:UpdateContainerService' :: UpdateContainerService -> Maybe Natural
$sel:publicDomainNames:UpdateContainerService' :: UpdateContainerService -> Maybe (HashMap Text [Text])
$sel:privateRegistryAccess:UpdateContainerService' :: UpdateContainerService -> Maybe PrivateRegistryAccessRequest
$sel:power:UpdateContainerService' :: UpdateContainerService -> Maybe ContainerServicePowerName
$sel:isDisabled:UpdateContainerService' :: UpdateContainerService -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"isDisabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isDisabled,
            (Key
"power" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerServicePowerName
power,
            (Key
"privateRegistryAccess" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PrivateRegistryAccessRequest
privateRegistryAccess,
            (Key
"publicDomainNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
publicDomainNames,
            (Key
"scale" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
scale,
            forall a. a -> Maybe a
Prelude.Just (Key
"serviceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceName)
          ]
      )

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

instance Data.ToQuery UpdateContainerService where
  toQuery :: UpdateContainerService -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'UpdateContainerServiceResponse' 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:
--
-- 'containerService', 'updateContainerServiceResponse_containerService' - An object that describes a container service.
--
-- 'httpStatus', 'updateContainerServiceResponse_httpStatus' - The response's http status code.
newUpdateContainerServiceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateContainerServiceResponse
newUpdateContainerServiceResponse :: Int -> UpdateContainerServiceResponse
newUpdateContainerServiceResponse Int
pHttpStatus_ =
  UpdateContainerServiceResponse'
    { $sel:containerService:UpdateContainerServiceResponse' :: Maybe ContainerService
containerService =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateContainerServiceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that describes a container service.
updateContainerServiceResponse_containerService :: Lens.Lens' UpdateContainerServiceResponse (Prelude.Maybe ContainerService)
updateContainerServiceResponse_containerService :: Lens' UpdateContainerServiceResponse (Maybe ContainerService)
updateContainerServiceResponse_containerService = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContainerServiceResponse' {Maybe ContainerService
containerService :: Maybe ContainerService
$sel:containerService:UpdateContainerServiceResponse' :: UpdateContainerServiceResponse -> Maybe ContainerService
containerService} -> Maybe ContainerService
containerService) (\s :: UpdateContainerServiceResponse
s@UpdateContainerServiceResponse' {} Maybe ContainerService
a -> UpdateContainerServiceResponse
s {$sel:containerService:UpdateContainerServiceResponse' :: Maybe ContainerService
containerService = Maybe ContainerService
a} :: UpdateContainerServiceResponse)

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

instance
  Prelude.NFData
    UpdateContainerServiceResponse
  where
  rnf :: UpdateContainerServiceResponse -> ()
rnf UpdateContainerServiceResponse' {Int
Maybe ContainerService
httpStatus :: Int
containerService :: Maybe ContainerService
$sel:httpStatus:UpdateContainerServiceResponse' :: UpdateContainerServiceResponse -> Int
$sel:containerService:UpdateContainerServiceResponse' :: UpdateContainerServiceResponse -> Maybe ContainerService
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerService
containerService
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus