{-# 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.Create -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Creates a FHIR resource. Implements the FHIR standard [create -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#create), -- which creates a new resource with a server-assigned resource ID. Also -- supports the FHIR standard [conditional create -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#ccreate), -- specified by supplying an \`If-None-Exist\` header containing a FHIR -- search query. If no resources match this search query, the server -- processes the create operation as normal. 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 resource as it was -- created on the server, including the server-assigned resource ID and -- 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.create@. module Network.Google.Resource.Healthcare.Projects.Locations.DataSets.FhirStores.Fhir.Create ( -- * REST Resource ProjectsLocationsDataSetsFhirStoresFhirCreateResource -- * Creating a Request , projectsLocationsDataSetsFhirStoresFhirCreate , ProjectsLocationsDataSetsFhirStoresFhirCreate -- * Request Lenses , proParent , proXgafv , proUploadProtocol , proAccessToken , proUploadType , proPayload , proType , proCallback ) where import Network.Google.Healthcare.Types import Network.Google.Prelude -- | A resource alias for @healthcare.projects.locations.datasets.fhirStores.fhir.create@ method which the -- 'ProjectsLocationsDataSetsFhirStoresFhirCreate' request conforms to. type ProjectsLocationsDataSetsFhirStoresFhirCreateResource = "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 :> Post '[JSON] HTTPBody -- | Creates a FHIR resource. Implements the FHIR standard [create -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#create), -- which creates a new resource with a server-assigned resource ID. Also -- supports the FHIR standard [conditional create -- interaction](http:\/\/hl7.org\/implement\/standards\/fhir\/STU3\/http.html#ccreate), -- specified by supplying an \`If-None-Exist\` header containing a FHIR -- search query. If no resources match this search query, the server -- processes the create operation as normal. 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 resource as it was -- created on the server, including the server-assigned resource ID and -- 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:/ 'projectsLocationsDataSetsFhirStoresFhirCreate' smart constructor. data ProjectsLocationsDataSetsFhirStoresFhirCreate = ProjectsLocationsDataSetsFhirStoresFhirCreate' { _proParent :: !Text , _proXgafv :: !(Maybe Xgafv) , _proUploadProtocol :: !(Maybe Text) , _proAccessToken :: !(Maybe Text) , _proUploadType :: !(Maybe Text) , _proPayload :: !HTTPBody , _proType :: !Text , _proCallback :: !(Maybe Text) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'ProjectsLocationsDataSetsFhirStoresFhirCreate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'proParent' -- -- * 'proXgafv' -- -- * 'proUploadProtocol' -- -- * 'proAccessToken' -- -- * 'proUploadType' -- -- * 'proPayload' -- -- * 'proType' -- -- * 'proCallback' projectsLocationsDataSetsFhirStoresFhirCreate :: Text -- ^ 'proParent' -> HTTPBody -- ^ 'proPayload' -> Text -- ^ 'proType' -> ProjectsLocationsDataSetsFhirStoresFhirCreate projectsLocationsDataSetsFhirStoresFhirCreate pProParent_ pProPayload_ pProType_ = ProjectsLocationsDataSetsFhirStoresFhirCreate' { _proParent = pProParent_ , _proXgafv = Nothing , _proUploadProtocol = Nothing , _proAccessToken = Nothing , _proUploadType = Nothing , _proPayload = pProPayload_ , _proType = pProType_ , _proCallback = Nothing } -- | The name of the FHIR store this resource belongs to. proParent :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate Text proParent = lens _proParent (\ s a -> s{_proParent = a}) -- | V1 error format. proXgafv :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate (Maybe Xgafv) proXgafv = lens _proXgafv (\ s a -> s{_proXgafv = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). proUploadProtocol :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate (Maybe Text) proUploadProtocol = lens _proUploadProtocol (\ s a -> s{_proUploadProtocol = a}) -- | OAuth access token. proAccessToken :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate (Maybe Text) proAccessToken = lens _proAccessToken (\ s a -> s{_proAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). proUploadType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate (Maybe Text) proUploadType = lens _proUploadType (\ s a -> s{_proUploadType = a}) -- | Multipart request metadata. proPayload :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate HTTPBody proPayload = lens _proPayload (\ s a -> s{_proPayload = a}) -- | The type of the resource to create. proType :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate Text proType = lens _proType (\ s a -> s{_proType = a}) -- | JSONP proCallback :: Lens' ProjectsLocationsDataSetsFhirStoresFhirCreate (Maybe Text) proCallback = lens _proCallback (\ s a -> s{_proCallback = a}) instance GoogleRequest ProjectsLocationsDataSetsFhirStoresFhirCreate where type Rs ProjectsLocationsDataSetsFhirStoresFhirCreate = HTTPBody type Scopes ProjectsLocationsDataSetsFhirStoresFhirCreate = '["https://www.googleapis.com/auth/cloud-platform"] requestClient ProjectsLocationsDataSetsFhirStoresFhirCreate'{..} = go _proParent _proType _proXgafv _proUploadProtocol _proAccessToken _proUploadType _proCallback (Just AltJSON) _proPayload healthcareService where go = buildClient (Proxy :: Proxy ProjectsLocationsDataSetsFhirStoresFhirCreateResource) mempty