{-# 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.ConditionalUpdate -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- If a resource is found based on the search criteria specified in the -- query parameters, updates the entire contents of that resource. -- Implements the FHIR standard [conditional update -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#cond-update). -- Search terms are provided as query parameters following the same pattern -- as the search method. If the search criteria identify more than one -- match, the request will return a \`412 Precondition Failed\` error. If -- the search criteria identify zero matches, and the supplied resource -- body contains an \`id\`, and the FHIR store has -- [enable_update_create](FhirStore.enable_update_create) set, creates the -- resource with the client-specified ID. If the search criteria identify -- zero matches, and the supplied resource body does not contain an \`id\`, -- the resource will be created with a server-assigned ID as per the create -- method. The request body must contain a JSON-encoded FHIR resource, and -- the request headers must contain \`Content-Type: -- application\/fhir+json\`. On success, the response body will contain a -- JSON-encoded representation of the updated resource, including the -- server-assigned version ID. 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.conditionalUpdate@. module Network.Google.Resource.Healthcare.Projects.Locations.DataSets.FhirStores.Fhir.ConditionalUpdate ( -- * REST Resource ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdateResource -- * Creating a Request , projectsLocationsDataSetsFhirStoresFhirConditionalUpdate , ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate -- * Request Lenses , pldsfsfcuParent , pldsfsfcuXgafv , pldsfsfcuUploadProtocol , pldsfsfcuAccessToken , pldsfsfcuUploadType , pldsfsfcuPayload , pldsfsfcuType , pldsfsfcuCallback ) where import Network.Google.Healthcare.Types import Network.Google.Prelude -- | A resource alias for @healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate@ method which the -- 'ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate' request conforms to. type ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdateResource = "v1beta1" :> Capture "parent" Text :> "fhir" :> Capture "type" Text :> QueryParam "$.xgafv" Xgafv :> QueryParam "upload_protocol" Text :> QueryParam "access_token" Text :> QueryParam "uploadType" Text :> QueryParam "callback" Text :> QueryParam "alt" AltJSON :> ReqBody '[JSON] HTTPBody :> Put '[JSON] HTTPBody -- | If a resource is found based on the search criteria specified in the -- query parameters, updates the entire contents of that resource. -- Implements the FHIR standard [conditional update -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#cond-update). -- Search terms are provided as query parameters following the same pattern -- as the search method. If the search criteria identify more than one -- match, the request will return a \`412 Precondition Failed\` error. If -- the search criteria identify zero matches, and the supplied resource -- body contains an \`id\`, and the FHIR store has -- [enable_update_create](FhirStore.enable_update_create) set, creates the -- resource with the client-specified ID. If the search criteria identify -- zero matches, and the supplied resource body does not contain an \`id\`, -- the resource will be created with a server-assigned ID as per the create -- method. The request body must contain a JSON-encoded FHIR resource, and -- the request headers must contain \`Content-Type: -- application\/fhir+json\`. On success, the response body will contain a -- JSON-encoded representation of the updated resource, including the -- server-assigned version ID. 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:/ 'projectsLocationsDataSetsFhirStoresFhirConditionalUpdate' smart constructor. data ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate = ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate' { _pldsfsfcuParent :: !Text , _pldsfsfcuXgafv :: !(Maybe Xgafv) , _pldsfsfcuUploadProtocol :: !(Maybe Text) , _pldsfsfcuAccessToken :: !(Maybe Text) , _pldsfsfcuUploadType :: !(Maybe Text) , _pldsfsfcuPayload :: !HTTPBody , _pldsfsfcuType :: !Text , _pldsfsfcuCallback :: !(Maybe Text) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pldsfsfcuParent' -- -- * 'pldsfsfcuXgafv' -- -- * 'pldsfsfcuUploadProtocol' -- -- * 'pldsfsfcuAccessToken' -- -- * 'pldsfsfcuUploadType' -- -- * 'pldsfsfcuPayload' -- -- * 'pldsfsfcuType' -- -- * 'pldsfsfcuCallback' projectsLocationsDataSetsFhirStoresFhirConditionalUpdate :: Text -- ^ 'pldsfsfcuParent' -> HTTPBody -- ^ 'pldsfsfcuPayload' -> Text -- ^ 'pldsfsfcuType' -> ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate projectsLocationsDataSetsFhirStoresFhirConditionalUpdate pPldsfsfcuParent_ pPldsfsfcuPayload_ pPldsfsfcuType_ = ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate' { _pldsfsfcuParent = pPldsfsfcuParent_ , _pldsfsfcuXgafv = Nothing , _pldsfsfcuUploadProtocol = Nothing , _pldsfsfcuAccessToken = Nothing , _pldsfsfcuUploadType = Nothing , _pldsfsfcuPayload = pPldsfsfcuPayload_ , _pldsfsfcuType = pPldsfsfcuType_ , _pldsfsfcuCallback = Nothing } -- | The name of the FHIR store this resource belongs to. pldsfsfcuParent :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate Text pldsfsfcuParent = lens _pldsfsfcuParent (\ s a -> s{_pldsfsfcuParent = a}) -- | V1 error format. pldsfsfcuXgafv :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate (Maybe Xgafv) pldsfsfcuXgafv = lens _pldsfsfcuXgafv (\ s a -> s{_pldsfsfcuXgafv = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). pldsfsfcuUploadProtocol :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate (Maybe Text) pldsfsfcuUploadProtocol = lens _pldsfsfcuUploadProtocol (\ s a -> s{_pldsfsfcuUploadProtocol = a}) -- | OAuth access token. pldsfsfcuAccessToken :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate (Maybe Text) pldsfsfcuAccessToken = lens _pldsfsfcuAccessToken (\ s a -> s{_pldsfsfcuAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pldsfsfcuUploadType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate (Maybe Text) pldsfsfcuUploadType = lens _pldsfsfcuUploadType (\ s a -> s{_pldsfsfcuUploadType = a}) -- | Multipart request metadata. pldsfsfcuPayload :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate HTTPBody pldsfsfcuPayload = lens _pldsfsfcuPayload (\ s a -> s{_pldsfsfcuPayload = a}) -- | The type of the resource to update. pldsfsfcuType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate Text pldsfsfcuType = lens _pldsfsfcuType (\ s a -> s{_pldsfsfcuType = a}) -- | JSONP pldsfsfcuCallback :: Lens' ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate (Maybe Text) pldsfsfcuCallback = lens _pldsfsfcuCallback (\ s a -> s{_pldsfsfcuCallback = a}) instance GoogleRequest ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate where type Rs ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate = HTTPBody type Scopes ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate = '["https://www.googleapis.com/auth/cloud-platform"] requestClient ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdate'{..} = go _pldsfsfcuParent _pldsfsfcuType _pldsfsfcuXgafv _pldsfsfcuUploadProtocol _pldsfsfcuAccessToken _pldsfsfcuUploadType _pldsfsfcuCallback (Just AltJSON) _pldsfsfcuPayload healthcareService where go = buildClient (Proxy :: Proxy ProjectsLocationsDataSetsFhirStoresFhirConditionalUpdateResource) mempty