@@ -0,0 +1,178 @@
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 #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.AndroidPublisher.Edits.DeobfuscationFiles.Upload
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+-- Uploads the deobfuscation file of the specified APK. If a deobfuscation
24+-- file already exists, it will be replaced.
25+--
26+-- /See:/ <https://developers.google.com/android-publisher Google Play Developer API Reference> for @androidpublisher.edits.deobfuscationfiles.upload@.
27+module Network.Google.Resource.AndroidPublisher.Edits.DeobfuscationFiles.Upload
28+ (
29+ -- * REST Resource
30+ EditsDeobfuscationFilesUploadResource
31+
32+ -- * Creating a Request
33+ , editsDeobfuscationFilesUpload
34+ , EditsDeobfuscationFilesUpload
35+
36+ -- * Request Lenses
37+ , edfuDeobfuscationFileType
38+ , edfuPackageName
39+ , edfuAPKVersionCode
40+ , edfuEditId
41+ ) where
42+
43+import Network.Google.AndroidPublisher.Types
44+import Network.Google.Prelude
45+
46+-- | A resource alias for @androidpublisher.edits.deobfuscationfiles.upload@ method which the
47+-- 'EditsDeobfuscationFilesUpload' request conforms to.
48+type EditsDeobfuscationFilesUploadResource =
49+ "androidpublisher" :>
50+ "v2" :>
51+ "applications" :>
52+ Capture "packageName" Text :>
53+ "edits" :>
54+ Capture "editId" Text :>
55+ "apks" :>
56+ Capture "apkVersionCode" (Textual Int32) :>
57+ "deobfuscationFiles" :>
58+ Capture "deobfuscationFileType"
59+ EditsDeobfuscationFilesUploadDeobfuscationFileType
60+ :>
61+ QueryParam "alt" AltJSON :>
62+ Post '[JSON] DeobfuscationFilesUploadResponse
63+ :<|>
64+ "upload" :>
65+ "androidpublisher" :>
66+ "v2" :>
67+ "applications" :>
68+ Capture "packageName" Text :>
69+ "edits" :>
70+ Capture "editId" Text :>
71+ "apks" :>
72+ Capture "apkVersionCode" (Textual Int32) :>
73+ "deobfuscationFiles" :>
74+ Capture "deobfuscationFileType"
75+ EditsDeobfuscationFilesUploadDeobfuscationFileType
76+ :>
77+ QueryParam "alt" AltJSON :>
78+ QueryParam "uploadType" AltMedia :>
79+ AltMedia :>
80+ Post '[JSON] DeobfuscationFilesUploadResponse
81+
82+-- | Uploads the deobfuscation file of the specified APK. If a deobfuscation
83+-- file already exists, it will be replaced.
84+--
85+-- /See:/ 'editsDeobfuscationFilesUpload' smart constructor.
86+data EditsDeobfuscationFilesUpload = EditsDeobfuscationFilesUpload'
87+ { _edfuDeobfuscationFileType :: !EditsDeobfuscationFilesUploadDeobfuscationFileType
88+ , _edfuPackageName :: !Text
89+ , _edfuAPKVersionCode :: !(Textual Int32)
90+ , _edfuEditId :: !Text
91+ } deriving (Eq,Show,Data,Typeable,Generic)
92+
93+-- | Creates a value of 'EditsDeobfuscationFilesUpload' with the minimum fields required to make a request.
94+--
95+-- Use one of the following lenses to modify other fields as desired:
96+--
97+-- * 'edfuDeobfuscationFileType'
98+--
99+-- * 'edfuPackageName'
100+--
101+-- * 'edfuAPKVersionCode'
102+--
103+-- * 'edfuEditId'
104+editsDeobfuscationFilesUpload
105+ :: EditsDeobfuscationFilesUploadDeobfuscationFileType -- ^ 'edfuDeobfuscationFileType'
106+ -> Text -- ^ 'edfuPackageName'
107+ -> Int32 -- ^ 'edfuAPKVersionCode'
108+ -> Text -- ^ 'edfuEditId'
109+ -> EditsDeobfuscationFilesUpload
110+editsDeobfuscationFilesUpload pEdfuDeobfuscationFileType_ pEdfuPackageName_ pEdfuAPKVersionCode_ pEdfuEditId_ =
111+ EditsDeobfuscationFilesUpload'
112+ { _edfuDeobfuscationFileType = pEdfuDeobfuscationFileType_
113+ , _edfuPackageName = pEdfuPackageName_
114+ , _edfuAPKVersionCode = _Coerce # pEdfuAPKVersionCode_
115+ , _edfuEditId = pEdfuEditId_
116+ }
117+
118+edfuDeobfuscationFileType :: Lens' EditsDeobfuscationFilesUpload EditsDeobfuscationFilesUploadDeobfuscationFileType
119+edfuDeobfuscationFileType
120+ = lens _edfuDeobfuscationFileType
121+ (\ s a -> s{_edfuDeobfuscationFileType = a})
122+
123+-- | Unique identifier of the Android app for which the deobfuscatiuon files
124+-- are being uploaded; for example, \"com.spiffygame\".
125+edfuPackageName :: Lens' EditsDeobfuscationFilesUpload Text
126+edfuPackageName
127+ = lens _edfuPackageName
128+ (\ s a -> s{_edfuPackageName = a})
129+
130+-- | The version code of the APK whose deobfuscation file is being uploaded.
131+edfuAPKVersionCode :: Lens' EditsDeobfuscationFilesUpload Int32
132+edfuAPKVersionCode
133+ = lens _edfuAPKVersionCode
134+ (\ s a -> s{_edfuAPKVersionCode = a})
135+ . _Coerce
136+
137+-- | Unique identifier for this edit.
138+edfuEditId :: Lens' EditsDeobfuscationFilesUpload Text
139+edfuEditId
140+ = lens _edfuEditId (\ s a -> s{_edfuEditId = a})
141+
142+instance GoogleRequest EditsDeobfuscationFilesUpload
143+ where
144+ type Rs EditsDeobfuscationFilesUpload =
145+ DeobfuscationFilesUploadResponse
146+ type Scopes EditsDeobfuscationFilesUpload =
147+ '["https://www.googleapis.com/auth/androidpublisher"]
148+ requestClient EditsDeobfuscationFilesUpload'{..}
149+ = go _edfuPackageName _edfuEditId _edfuAPKVersionCode
150+ _edfuDeobfuscationFileType
151+ (Just AltJSON)
152+ androidPublisherService
153+ where go :<|> _
154+ = buildClient
155+ (Proxy ::
156+ Proxy EditsDeobfuscationFilesUploadResource)
157+ mempty
158+
159+instance GoogleRequest
160+ (MediaUpload EditsDeobfuscationFilesUpload) where
161+ type Rs (MediaUpload EditsDeobfuscationFilesUpload) =
162+ DeobfuscationFilesUploadResponse
163+ type Scopes
164+ (MediaUpload EditsDeobfuscationFilesUpload)
165+ = Scopes EditsDeobfuscationFilesUpload
166+ requestClient
167+ (MediaUpload EditsDeobfuscationFilesUpload'{..} body)
168+ = go _edfuPackageName _edfuEditId _edfuAPKVersionCode
169+ _edfuDeobfuscationFileType
170+ (Just AltJSON)
171+ (Just AltMedia)
172+ body
173+ androidPublisherService
174+ where _ :<|> go
175+ = buildClient
176+ (Proxy ::
177+ Proxy EditsDeobfuscationFilesUploadResource)
178+ mempty