{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.Healthcare.Projects.Locations.DataSets.FhirStores.Fhir.ObservationLastn -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Retrieves the N most recent \`Observation\` resources for a subject -- matching search criteria specified as query parameters, grouped by -- \`Observation.code\`, sorted from most recent to oldest. Implements the -- FHIR extended operation -- [Observation-lastn](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/observation-operations.html#lastn). -- Search terms are provided as query parameters following the same pattern -- as the search method. This operation accepts an additional query -- parameter \`max\`, which specifies N, the maximum number of Observations -- to return from each group, with a default of 1. On success, the response -- body will contain a JSON-encoded representation of a \`Bundle\` resource -- of type \`searchset\`, containing the results of the operation. Errors -- generated by the FHIR store will contain a JSON-encoded -- \`OperationOutcome\` resource describing the reason for the error. If -- the request cannot be mapped to a valid API method on a FHIR store, a -- generic GCP error might be returned instead. -- -- /See:/ for @healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn@. module Network.Google.Resource.Healthcare.Projects.Locations.DataSets.FhirStores.Fhir.ObservationLastn ( -- * REST Resource ProjectsLocationsDataSetsFhirStoresFhirObservationLastnResource -- * Creating a Request , projectsLocationsDataSetsFhirStoresFhirObservationLastn , ProjectsLocationsDataSetsFhirStoresFhirObservationLastn -- * Request Lenses , pldsfsfolParent , pldsfsfolXgafv , pldsfsfolUploadProtocol , pldsfsfolAccessToken , pldsfsfolUploadType , pldsfsfolCallback ) where import Network.Google.Healthcare.Types import Network.Google.Prelude -- | A resource alias for @healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn@ method which the -- 'ProjectsLocationsDataSetsFhirStoresFhirObservationLastn' request conforms to. type ProjectsLocationsDataSetsFhirStoresFhirObservationLastnResource = "v1beta1" :> Capture "parent" Text :> "fhir" :> "Observation" :> "$lastn" :> QueryParam "$.xgafv" Xgafv :> QueryParam "upload_protocol" Text :> QueryParam "access_token" Text :> QueryParam "uploadType" Text :> QueryParam "callback" Text :> QueryParam "alt" AltJSON :> Get '[JSON] HTTPBody -- | Retrieves the N most recent \`Observation\` resources for a subject -- matching search criteria specified as query parameters, grouped by -- \`Observation.code\`, sorted from most recent to oldest. Implements the -- FHIR extended operation -- [Observation-lastn](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/observation-operations.html#lastn). -- Search terms are provided as query parameters following the same pattern -- as the search method. This operation accepts an additional query -- parameter \`max\`, which specifies N, the maximum number of Observations -- to return from each group, with a default of 1. On success, the response -- body will contain a JSON-encoded representation of a \`Bundle\` resource -- of type \`searchset\`, containing the results of the operation. Errors -- generated by the FHIR store will contain a JSON-encoded -- \`OperationOutcome\` resource describing the reason for the error. If -- the request cannot be mapped to a valid API method on a FHIR store, a -- generic GCP error might be returned instead. -- -- /See:/ 'projectsLocationsDataSetsFhirStoresFhirObservationLastn' smart constructor. data ProjectsLocationsDataSetsFhirStoresFhirObservationLastn = ProjectsLocationsDataSetsFhirStoresFhirObservationLastn' { _pldsfsfolParent :: !Text , _pldsfsfolXgafv :: !(Maybe Xgafv) , _pldsfsfolUploadProtocol :: !(Maybe Text) , _pldsfsfolAccessToken :: !(Maybe Text) , _pldsfsfolUploadType :: !(Maybe Text) , _pldsfsfolCallback :: !(Maybe Text) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'ProjectsLocationsDataSetsFhirStoresFhirObservationLastn' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pldsfsfolParent' -- -- * 'pldsfsfolXgafv' -- -- * 'pldsfsfolUploadProtocol' -- -- * 'pldsfsfolAccessToken' -- -- * 'pldsfsfolUploadType' -- -- * 'pldsfsfolCallback' projectsLocationsDataSetsFhirStoresFhirObservationLastn :: Text -- ^ 'pldsfsfolParent' -> ProjectsLocationsDataSetsFhirStoresFhirObservationLastn projectsLocationsDataSetsFhirStoresFhirObservationLastn pPldsfsfolParent_ = ProjectsLocationsDataSetsFhirStoresFhirObservationLastn' { _pldsfsfolParent = pPldsfsfolParent_ , _pldsfsfolXgafv = Nothing , _pldsfsfolUploadProtocol = Nothing , _pldsfsfolAccessToken = Nothing , _pldsfsfolUploadType = Nothing , _pldsfsfolCallback = Nothing } -- | Name of the FHIR store to retrieve resources from. pldsfsfolParent :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn Text pldsfsfolParent = lens _pldsfsfolParent (\ s a -> s{_pldsfsfolParent = a}) -- | V1 error format. pldsfsfolXgafv :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn (Maybe Xgafv) pldsfsfolXgafv = lens _pldsfsfolXgafv (\ s a -> s{_pldsfsfolXgafv = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). pldsfsfolUploadProtocol :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn (Maybe Text) pldsfsfolUploadProtocol = lens _pldsfsfolUploadProtocol (\ s a -> s{_pldsfsfolUploadProtocol = a}) -- | OAuth access token. pldsfsfolAccessToken :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn (Maybe Text) pldsfsfolAccessToken = lens _pldsfsfolAccessToken (\ s a -> s{_pldsfsfolAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pldsfsfolUploadType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn (Maybe Text) pldsfsfolUploadType = lens _pldsfsfolUploadType (\ s a -> s{_pldsfsfolUploadType = a}) -- | JSONP pldsfsfolCallback :: Lens' ProjectsLocationsDataSetsFhirStoresFhirObservationLastn (Maybe Text) pldsfsfolCallback = lens _pldsfsfolCallback (\ s a -> s{_pldsfsfolCallback = a}) instance GoogleRequest ProjectsLocationsDataSetsFhirStoresFhirObservationLastn where type Rs ProjectsLocationsDataSetsFhirStoresFhirObservationLastn = HTTPBody type Scopes ProjectsLocationsDataSetsFhirStoresFhirObservationLastn = '["https://www.googleapis.com/auth/cloud-platform"] requestClient ProjectsLocationsDataSetsFhirStoresFhirObservationLastn'{..} = go _pldsfsfolParent _pldsfsfolXgafv _pldsfsfolUploadProtocol _pldsfsfolAccessToken _pldsfsfolUploadType _pldsfsfolCallback (Just AltJSON) healthcareService where go = buildClient (Proxy :: Proxy ProjectsLocationsDataSetsFhirStoresFhirObservationLastnResource) mempty