<commit_before>{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE TemplateHaskell            #-}

-- |
-- Module      : Network.AWS.Route53
-- Copyright   : (c) 2013 <NAME> <<EMAIL>>
-- License     : This Source Code Form is subject to the terms of
--               the Mozilla Public License, v. 2.0.
--               A copy of the MPL can be found in the LICENSE file or
--               you can obtain it at http://mozilla.org/MPL/2.0/.
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : experimental
-- Portability : non-portable (GHC extensions)

module Network.AWS.Route53 where

import           Control.Applicative
import           Control.Monad
import           Control.Monad.IO.Class
import           Control.Monad.Reader
import           Data.Aeson
import           Data.ByteString        (ByteString)
import qualified Data.ByteString.Char8  as BS
import qualified Data.ByteString.Lazy   as LBS
import           Data.Data
import           Data.Maybe
import           Data.Monoid
import           Data.Time
import           GHC.Word
import           Network.AWS.Request
import           Network.AWS.TH
import           Network.Http.Client
import           OpenSSL                (withOpenSSL)
import           System.IO.Streams      (InputStream, OutputStream, stdout)
import qualified System.IO.Streams      as Streams
import           Text.Hastache
import           Text.Hastache.Context

data CreateHealthCheck = CreateHealthCheck
    { chcCallerRef :: String
    , chcIpAddress :: String
    , chcPort      :: Word16
    , chcProtocol  :: String
    , chcResource  :: String
    , chcFQDN      :: String
    } deriving (Data, Typeable)

-- FIXME: Use template haskell for instances
-- Function which determines the template from the class name underscored
-- and takes the uri as an argument
-- use TH to read in the actual template at compile time and set it to
-- the template typeclass function :: ByteString
instance AWSRequest CreateHealthCheck where
    template _ = $(embedTemplate "route53/create_health_check")
    endpoint _ = route53Base
    request  _ = version3 POST route53Base "healthcheck" []

route53Base :: ByteString
route53Base = "route53.amazonaws.com"
<commit_msg>Trying out type class based approach for command definitions<commit_after>{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE TemplateHaskell            #-}

-- |
-- Module      : Network.AWS.Route53
-- Copyright   : (c) 2013 <NAME> <<EMAIL>>
-- License     : This Source Code Form is subject to the terms of
--               the Mozilla Public License, v. 2.0.
--               A copy of the MPL can be found in the LICENSE file or
--               you can obtain it at http://mozilla.org/MPL/2.0/.
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : experimental
-- Portability : non-portable (GHC extensions)

module Network.AWS.Route53 where

import Data.Data
import GHC.Word
import Network.AWS.Request
import Network.AWS.TH
import Network.Http.Client

data CreateHealthCheck = CreateHealthCheck
    { chcCallerRef :: String
    , chcIpAddress :: String
    , chcPort      :: Word16
    , chcProtocol  :: String
    , chcResource  :: String
    , chcFQDN      :: String
    } deriving (Data, Typeable)

-- FIXME: Use template haskell for instances
-- Function which determines the template from the class name underscored
-- and takes the uri as an argument
-- use TH to read in the actual template at compile time and set it to
-- the template typeclass function :: ByteString
instance AWSRequest CreateHealthCheck where
    template _ = $(embedTemplate "route53/create_health_check")
    endpoint _ = route53Base
    request  _ = version3 POST route53Base "healthcheck" []

route53Base :: ByteString
route53Base = "route53.amazonaws.com"

{'fraction_non_alphanumeric': 0.08636137381781982, 'fraction_numerical': 0.01368840219014435, 'mean_word_length': 2.4796536796536794, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3596530', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1127, 'n_words': 364}