Skip to content

Commit

Permalink
Regenerating amazonka-ecr from latest service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed Nov 29, 2016
1 parent 4117a08 commit 3362a22
Show file tree
Hide file tree
Showing 11 changed files with 411 additions and 7 deletions.
1 change: 1 addition & 0 deletions amazonka-ecr/amazonka-ecr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ library
, Network.AWS.ECR.CreateRepository
, Network.AWS.ECR.DeleteRepository
, Network.AWS.ECR.DeleteRepositoryPolicy
, Network.AWS.ECR.DescribeImages
, Network.AWS.ECR.DescribeRepositories
, Network.AWS.ECR.GetAuthorizationToken
, Network.AWS.ECR.GetDownloadURLForLayer
Expand Down
Empty file.
Empty file.
25 changes: 24 additions & 1 deletion amazonka-ecr/gen/Network/AWS/ECR.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module Network.AWS.ECR
-- ** LayerPartTooSmallException
, _LayerPartTooSmallException

-- ** ImageNotFoundException
, _ImageNotFoundException

-- ** ImageAlreadyExistsException
, _ImageAlreadyExistsException

Expand Down Expand Up @@ -94,7 +97,7 @@ module Network.AWS.ECR
-- ** CompleteLayerUpload
, module Network.AWS.ECR.CompleteLayerUpload

-- ** DescribeRepositories
-- ** DescribeRepositories (Paginated)
, module Network.AWS.ECR.DescribeRepositories

-- ** UploadLayerPart
Expand Down Expand Up @@ -124,6 +127,9 @@ module Network.AWS.ECR
-- ** GetDownloadURLForLayer
, module Network.AWS.ECR.GetDownloadURLForLayer

-- ** DescribeImages (Paginated)
, module Network.AWS.ECR.DescribeImages

-- * Types

-- ** ImageFailureCode
Expand All @@ -145,6 +151,11 @@ module Network.AWS.ECR
, adProxyEndpoint
, adAuthorizationToken

-- ** DescribeImagesFilter
, DescribeImagesFilter
, describeImagesFilter
, difTagStatus

-- ** Image
, Image
, image
Expand All @@ -153,6 +164,16 @@ module Network.AWS.ECR
, iRepositoryName
, iImageManifest

-- ** ImageDetail
, ImageDetail
, imageDetail
, idRegistryId
, idImageTags
, idImageSizeInBytes
, idImageDigest
, idImagePushedAt
, idRepositoryName

-- ** ImageFailure
, ImageFailure
, imageFailure
Expand Down Expand Up @@ -189,6 +210,7 @@ module Network.AWS.ECR
, Repository
, repository
, rRepositoryARN
, rCreatedAt
, rRegistryId
, rRepositoryURI
, rRepositoryName
Expand All @@ -201,6 +223,7 @@ import Network.AWS.ECR.CompleteLayerUpload
import Network.AWS.ECR.CreateRepository
import Network.AWS.ECR.DeleteRepository
import Network.AWS.ECR.DeleteRepositoryPolicy
import Network.AWS.ECR.DescribeImages
import Network.AWS.ECR.DescribeRepositories
import Network.AWS.ECR.GetAuthorizationToken
import Network.AWS.ECR.GetDownloadURLForLayer
Expand Down
4 changes: 2 additions & 2 deletions amazonka-ecr/gen/Network/AWS/ECR/CreateRepository.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ data CreateRepositoryResponse = CreateRepositoryResponse'
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'crrsRepository' - Undocumented member.
-- * 'crrsRepository' - The repository that was created.
--
-- * 'crrsResponseStatus' - -- | The response status code.
createRepositoryResponse
Expand All @@ -123,7 +123,7 @@ createRepositoryResponse pResponseStatus_ =
, _crrsResponseStatus = pResponseStatus_
}

-- | Undocumented member.
-- | The repository that was created.
crrsRepository :: Lens' CreateRepositoryResponse (Maybe Repository)
crrsRepository = lens _crrsRepository (\ s a -> s{_crrsRepository = a});

Expand Down
4 changes: 2 additions & 2 deletions amazonka-ecr/gen/Network/AWS/ECR/DeleteRepository.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ data DeleteRepositoryResponse = DeleteRepositoryResponse'
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'drsRepository' - Undocumented member.
-- * 'drsRepository' - The repository that was deleted.
--
-- * 'drsResponseStatus' - -- | The response status code.
deleteRepositoryResponse
Expand All @@ -143,7 +143,7 @@ deleteRepositoryResponse pResponseStatus_ =
, _drsResponseStatus = pResponseStatus_
}

-- | Undocumented member.
-- | The repository that was deleted.
drsRepository :: Lens' DeleteRepositoryResponse (Maybe Repository)
drsRepository = lens _drsRepository (\ s a -> s{_drsRepository = a});

Expand Down
205 changes: 205 additions & 0 deletions amazonka-ecr/gen/Network/AWS/ECR/DescribeImages.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}

{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module : Network.AWS.ECR.DescribeImages
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns metadata about the images in a repository, including image size and creation date.
--
--
--
-- This operation returns paginated results.
module Network.AWS.ECR.DescribeImages
(
-- * Creating a Request
describeImages
, DescribeImages
-- * Request Lenses
, diRegistryId
, diImageIds
, diNextToken
, diFilter
, diMaxResults
, diRepositoryName

-- * Destructuring the Response
, describeImagesResponse
, DescribeImagesResponse
-- * Response Lenses
, dirsImageDetails
, dirsNextToken
, dirsResponseStatus
) where

import Network.AWS.ECR.Types
import Network.AWS.ECR.Types.Product
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response

-- | /See:/ 'describeImages' smart constructor.
data DescribeImages = DescribeImages'
{ _diRegistryId :: !(Maybe Text)
, _diImageIds :: !(Maybe [ImageIdentifier])
, _diNextToken :: !(Maybe Text)
, _diFilter :: !(Maybe DescribeImagesFilter)
, _diMaxResults :: !(Maybe Nat)
, _diRepositoryName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeImages' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'diRegistryId' - The AWS account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.
--
-- * 'diImageIds' - The list of image IDs for the requested repository.
--
-- * 'diNextToken' - The @nextToken@ value returned from a previous paginated @DescribeImages@ request where @maxResults@ was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the @nextToken@ value. This value is @null@ when there are no more results to return.
--
-- * 'diFilter' - The filter key and value with which to filter your @DescribeImages@ results.
--
-- * 'diMaxResults' - The maximum number of repository results returned by @DescribeImages@ in paginated output. When this parameter is used, @DescribeImages@ only returns @maxResults@ results in a single page along with a @nextToken@ response element. The remaining results of the initial request can be seen by sending another @DescribeImages@ request with the returned @nextToken@ value. This value can be between 1 and 100. If this parameter is not used, then @DescribeImages@ returns up to 100 results and a @nextToken@ value, if applicable.
--
-- * 'diRepositoryName' - A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
describeImages
:: Text -- ^ 'diRepositoryName'
-> DescribeImages
describeImages pRepositoryName_ =
DescribeImages'
{ _diRegistryId = Nothing
, _diImageIds = Nothing
, _diNextToken = Nothing
, _diFilter = Nothing
, _diMaxResults = Nothing
, _diRepositoryName = pRepositoryName_
}

-- | The AWS account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.
diRegistryId :: Lens' DescribeImages (Maybe Text)
diRegistryId = lens _diRegistryId (\ s a -> s{_diRegistryId = a});

-- | The list of image IDs for the requested repository.
diImageIds :: Lens' DescribeImages [ImageIdentifier]
diImageIds = lens _diImageIds (\ s a -> s{_diImageIds = a}) . _Default . _Coerce;

-- | The @nextToken@ value returned from a previous paginated @DescribeImages@ request where @maxResults@ was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the @nextToken@ value. This value is @null@ when there are no more results to return.
diNextToken :: Lens' DescribeImages (Maybe Text)
diNextToken = lens _diNextToken (\ s a -> s{_diNextToken = a});

-- | The filter key and value with which to filter your @DescribeImages@ results.
diFilter :: Lens' DescribeImages (Maybe DescribeImagesFilter)
diFilter = lens _diFilter (\ s a -> s{_diFilter = a});

-- | The maximum number of repository results returned by @DescribeImages@ in paginated output. When this parameter is used, @DescribeImages@ only returns @maxResults@ results in a single page along with a @nextToken@ response element. The remaining results of the initial request can be seen by sending another @DescribeImages@ request with the returned @nextToken@ value. This value can be between 1 and 100. If this parameter is not used, then @DescribeImages@ returns up to 100 results and a @nextToken@ value, if applicable.
diMaxResults :: Lens' DescribeImages (Maybe Natural)
diMaxResults = lens _diMaxResults (\ s a -> s{_diMaxResults = a}) . mapping _Nat;

-- | A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
diRepositoryName :: Lens' DescribeImages Text
diRepositoryName = lens _diRepositoryName (\ s a -> s{_diRepositoryName = a});

instance AWSPager DescribeImages where
page rq rs
| stop (rs ^. dirsNextToken) = Nothing
| stop (rs ^. dirsImageDetails) = Nothing
| otherwise =
Just $ rq & diNextToken .~ rs ^. dirsNextToken

instance AWSRequest DescribeImages where
type Rs DescribeImages = DescribeImagesResponse
request = postJSON ecr
response
= receiveJSON
(\ s h x ->
DescribeImagesResponse' <$>
(x .?> "imageDetails" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))

instance Hashable DescribeImages

instance NFData DescribeImages

instance ToHeaders DescribeImages where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerRegistry_V20150921.DescribeImages"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])

instance ToJSON DescribeImages where
toJSON DescribeImages'{..}
= object
(catMaybes
[("registryId" .=) <$> _diRegistryId,
("imageIds" .=) <$> _diImageIds,
("nextToken" .=) <$> _diNextToken,
("filter" .=) <$> _diFilter,
("maxResults" .=) <$> _diMaxResults,
Just ("repositoryName" .= _diRepositoryName)])

instance ToPath DescribeImages where
toPath = const "/"

instance ToQuery DescribeImages where
toQuery = const mempty

-- | /See:/ 'describeImagesResponse' smart constructor.
data DescribeImagesResponse = DescribeImagesResponse'
{ _dirsImageDetails :: !(Maybe [ImageDetail])
, _dirsNextToken :: !(Maybe Text)
, _dirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeImagesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dirsImageDetails' - A list of 'ImageDetail' objects that contain data about the image.
--
-- * 'dirsNextToken' - The @nextToken@ value to include in a future @DescribeImages@ request. When the results of a @DescribeImages@ request exceed @maxResults@ , this value can be used to retrieve the next page of results. This value is @null@ when there are no more results to return.
--
-- * 'dirsResponseStatus' - -- | The response status code.
describeImagesResponse
:: Int -- ^ 'dirsResponseStatus'
-> DescribeImagesResponse
describeImagesResponse pResponseStatus_ =
DescribeImagesResponse'
{ _dirsImageDetails = Nothing
, _dirsNextToken = Nothing
, _dirsResponseStatus = pResponseStatus_
}

-- | A list of 'ImageDetail' objects that contain data about the image.
dirsImageDetails :: Lens' DescribeImagesResponse [ImageDetail]
dirsImageDetails = lens _dirsImageDetails (\ s a -> s{_dirsImageDetails = a}) . _Default . _Coerce;

-- | The @nextToken@ value to include in a future @DescribeImages@ request. When the results of a @DescribeImages@ request exceed @maxResults@ , this value can be used to retrieve the next page of results. This value is @null@ when there are no more results to return.
dirsNextToken :: Lens' DescribeImagesResponse (Maybe Text)
dirsNextToken = lens _dirsNextToken (\ s a -> s{_dirsNextToken = a});

-- | -- | The response status code.
dirsResponseStatus :: Lens' DescribeImagesResponse Int
dirsResponseStatus = lens _dirsResponseStatus (\ s a -> s{_dirsResponseStatus = a});

instance NFData DescribeImagesResponse
10 changes: 10 additions & 0 deletions amazonka-ecr/gen/Network/AWS/ECR/DescribeRepositories.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
-- Describes image repositories in a registry.
--
--
--
-- This operation returns paginated results.
module Network.AWS.ECR.DescribeRepositories
(
-- * Creating a Request
Expand All @@ -44,6 +46,7 @@ module Network.AWS.ECR.DescribeRepositories
import Network.AWS.ECR.Types
import Network.AWS.ECR.Types.Product
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
Expand Down Expand Up @@ -93,6 +96,13 @@ drNextToken = lens _drNextToken (\ s a -> s{_drNextToken = a});
drMaxResults :: Lens' DescribeRepositories (Maybe Natural)
drMaxResults = lens _drMaxResults (\ s a -> s{_drMaxResults = a}) . mapping _Nat;

instance AWSPager DescribeRepositories where
page rq rs
| stop (rs ^. drrsNextToken) = Nothing
| stop (rs ^. drrsRepositories) = Nothing
| otherwise =
Just $ rq & drNextToken .~ rs ^. drrsNextToken

instance AWSRequest DescribeRepositories where
type Rs DescribeRepositories =
DescribeRepositoriesResponse
Expand Down
Loading

0 comments on commit 3362a22

Please sign in to comment.