Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add STANDARD_IA to ObjectStorageClass #238

Merged
merged 2 commits into from Oct 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions amazonka-s3/gen/Network/AWS/S3/Types/Sum.hs
Expand Up @@ -363,21 +363,24 @@ data ObjectStorageClass
= OSCGlacier
| OSCReducedRedundancy
| OSCStandard
| OSCStandardIA
deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)

instance FromText ObjectStorageClass where
parser = takeLowerText >>= \case
"glacier" -> pure OSCGlacier
"reduced_redundancy" -> pure OSCReducedRedundancy
"standard" -> pure OSCStandard
"standard_ia" -> pure OSCStandardIA
e -> fromTextError $ "Failure parsing ObjectStorageClass from value: '" <> e
<> "'. Accepted values: GLACIER, REDUCED_REDUNDANCY, STANDARD"
<> "'. Accepted values: GLACIER, REDUCED_REDUNDANCY, STANDARD, STANDARD_IA"

instance ToText ObjectStorageClass where
toText = \case
OSCGlacier -> "GLACIER"
OSCReducedRedundancy -> "REDUCED_REDUNDANCY"
OSCStandard -> "STANDARD"
OSCStandardIA -> "STANDARD_IA"

instance Hashable ObjectStorageClass
instance ToByteString ObjectStorageClass
Expand Down Expand Up @@ -643,22 +646,22 @@ instance ToXML ServerSideEncryption where
data StorageClass
= ReducedRedundancy
| Standard
| StandardIa
| StandardIA
deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)

instance FromText StorageClass where
parser = takeLowerText >>= \case
"reduced_redundancy" -> pure ReducedRedundancy
"standard" -> pure Standard
"standard_ia" -> pure StandardIa
"standard_ia" -> pure StandardIA
e -> fromTextError $ "Failure parsing StorageClass from value: '" <> e
<> "'. Accepted values: REDUCED_REDUNDANCY, STANDARD, STANDARD_IA"

instance ToText StorageClass where
toText = \case
ReducedRedundancy -> "REDUCED_REDUNDANCY"
Standard -> "STANDARD"
StandardIa -> "STANDARD_IA"
StandardIA -> "STANDARD_IA"

instance Hashable StorageClass
instance ToByteString StorageClass
Expand All @@ -673,20 +676,20 @@ instance ToXML StorageClass where

data TransitionStorageClass
= TSCGlacier
| TSCStandardIa
| TSCStandardIA
deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)

instance FromText TransitionStorageClass where
parser = takeLowerText >>= \case
"glacier" -> pure TSCGlacier
"standard_ia" -> pure TSCStandardIa
"standard_ia" -> pure TSCStandardIA
e -> fromTextError $ "Failure parsing TransitionStorageClass from value: '" <> e
<> "'. Accepted values: GLACIER, STANDARD_IA"

instance ToText TransitionStorageClass where
toText = \case
TSCGlacier -> "GLACIER"
TSCStandardIa -> "STANDARD_IA"
TSCStandardIA -> "STANDARD_IA"

instance Hashable TransitionStorageClass
instance ToByteString TransitionStorageClass
Expand Down
8 changes: 8 additions & 0 deletions gen/annex/s3.json
Expand Up @@ -9,6 +9,14 @@
},
"CompletedPartList": {
"min": 1
},
"ObjectStorageClass": {
"enum": [
"STANDARD",
"STANDARD_IA",
"REDUCED_REDUNDANCY",
"GLACIER"
]
}
}
}
1 change: 1 addition & 0 deletions gen/src/Gen/Text.hs
Expand Up @@ -226,6 +226,7 @@ upperAcronym x = Fold.foldl' (flip (uncurry RE.replaceAll)) x xs
, ("Lt$", "LT")
, ("Gt$", "GT")
, ("X8664", "X86_64")
, ("Ia$", "IA")
]

acronyms :: [(String, String)]
Expand Down