on develop help sign in
176 lines 5.4 kB history raw
1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE DeriveGeneric #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE NoImplicitPrelude #-}
6{-# LANGUAGE OverloadedStrings #-}
7{-# LANGUAGE RecordWildCards #-}
8{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE TypeOperators #-}
11{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13{-# OPTIONS_GHC -fno-warn-unused-imports #-}
15-- |
16-- Module : Network.Google.Resource.ContainerAnalysis.Projects.Notes.Create
17-- Copyright : (c) 2015-2016 Brendan Hay
18-- License : Mozilla Public License, v. 2.0.
19-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20-- Stability : auto-generated
21-- Portability : non-portable (GHC extensions)
22--
23-- Creates a new note.
24--
25-- /See:/ <https://cloud.google.com/container-analysis/api/reference/rest/ Container Analysis API Reference> for @containeranalysis.projects.notes.create@.
26module Network.Google.Resource.ContainerAnalysis.Projects.Notes.Create
27 (
28 -- * REST Resource
29 ProjectsNotesCreateResource
31 -- * Creating a Request
32 , projectsNotesCreate
33 , ProjectsNotesCreate
35 -- * Request Lenses
36 , pncParent
37 , pncXgafv
38 , pncUploadProtocol
39 , pncAccessToken
40 , pncUploadType
41 , pncPayload
42 , pncNoteId
43 , pncCallback
44 ) where
46import Network.Google.ContainerAnalysis.Types
47import Network.Google.Prelude
49-- | A resource alias for @containeranalysis.projects.notes.create@ method which the
50-- 'ProjectsNotesCreate' request conforms to.
51type ProjectsNotesCreateResource =
52 "v1beta1" :>
53 Capture "parent" Text :>
54 "notes" :>
55 QueryParam "$.xgafv" Xgafv :>
56 QueryParam "upload_protocol" Text :>
57 QueryParam "access_token" Text :>
58 QueryParam "uploadType" Text :>
59 QueryParam "noteId" Text :>
60 QueryParam "callback" Text :>
61 QueryParam "alt" AltJSON :>
62 ReqBody '[JSON] Note :> Post '[JSON] Note
64-- | Creates a new note.
65--
66-- /See:/ 'projectsNotesCreate' smart constructor.
67data ProjectsNotesCreate =
68 ProjectsNotesCreate'
69 { _pncParent :: !Text
70 , _pncXgafv :: !(Maybe Xgafv)
71 , _pncUploadProtocol :: !(Maybe Text)
72 , _pncAccessToken :: !(Maybe Text)
73 , _pncUploadType :: !(Maybe Text)
74 , _pncPayload :: !Note
75 , _pncNoteId :: !(Maybe Text)
76 , _pncCallback :: !(Maybe Text)
77 }
78 deriving (Eq, Show, Data, Typeable, Generic)
81-- | Creates a value of 'ProjectsNotesCreate' with the minimum fields required to make a request.
82--
83-- Use one of the following lenses to modify other fields as desired:
84--
85-- * 'pncParent'
86--
87-- * 'pncXgafv'
88--
89-- * 'pncUploadProtocol'
90--
91-- * 'pncAccessToken'
92--
93-- * 'pncUploadType'
94--
95-- * 'pncPayload'
96--
97-- * 'pncNoteId'
98--
99-- * 'pncCallback'
100projectsNotesCreate
101 :: Text -- ^ 'pncParent'
102 -> Note -- ^ 'pncPayload'
103 -> ProjectsNotesCreate
104projectsNotesCreate pPncParent_ pPncPayload_ =
105 ProjectsNotesCreate'
106 { _pncParent = pPncParent_
107 , _pncXgafv = Nothing
108 , _pncUploadProtocol = Nothing
109 , _pncAccessToken = Nothing
110 , _pncUploadType = Nothing
111 , _pncPayload = pPncPayload_
112 , _pncNoteId = Nothing
113 , _pncCallback = Nothing
114 }
117-- | The name of the project in the form of \`projects\/[PROJECT_ID]\`, under
118-- which the note is to be created.
119pncParent :: Lens' ProjectsNotesCreate Text
120pncParent
121 = lens _pncParent (\ s a -> s{_pncParent = a})
123-- | V1 error format.
124pncXgafv :: Lens' ProjectsNotesCreate (Maybe Xgafv)
125pncXgafv = lens _pncXgafv (\ s a -> s{_pncXgafv = a})
127-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
128pncUploadProtocol :: Lens' ProjectsNotesCreate (Maybe Text)
129pncUploadProtocol
130 = lens _pncUploadProtocol
131 (\ s a -> s{_pncUploadProtocol = a})
133-- | OAuth access token.
134pncAccessToken :: Lens' ProjectsNotesCreate (Maybe Text)
135pncAccessToken
136 = lens _pncAccessToken
137 (\ s a -> s{_pncAccessToken = a})
139-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
140pncUploadType :: Lens' ProjectsNotesCreate (Maybe Text)
141pncUploadType
142 = lens _pncUploadType
143 (\ s a -> s{_pncUploadType = a})
145-- | Multipart request metadata.
146pncPayload :: Lens' ProjectsNotesCreate Note
147pncPayload
148 = lens _pncPayload (\ s a -> s{_pncPayload = a})
150-- | The ID to use for this note.
151pncNoteId :: Lens' ProjectsNotesCreate (Maybe Text)
152pncNoteId
153 = lens _pncNoteId (\ s a -> s{_pncNoteId = a})
155-- | JSONP
156pncCallback :: Lens' ProjectsNotesCreate (Maybe Text)
157pncCallback
158 = lens _pncCallback (\ s a -> s{_pncCallback = a})
160instance GoogleRequest ProjectsNotesCreate where
161 type Rs ProjectsNotesCreate = Note
162 type Scopes ProjectsNotesCreate =
163 '["https://www.googleapis.com/auth/cloud-platform"]
164 requestClient ProjectsNotesCreate'{..}
165 = go _pncParent _pncXgafv _pncUploadProtocol
166 _pncAccessToken
167 _pncUploadType
168 _pncNoteId
169 _pncCallback
170 (Just AltJSON)
171 _pncPayload
172 containerAnalysisService
173 where go
174 = buildClient
175 (Proxy :: Proxy ProjectsNotesCreateResource)
176 mempty