@@ -20,6 +20,172 @@ module Network.Google.ResourceManager.Types.Product where
2020import Network.Google.Prelude
2121import Network.Google.ResourceManager.Types.Sum
2222
23+-- | The \`Status\` type defines a logical error model that is suitable for
24+-- different programming environments, including REST APIs and RPC APIs. It
25+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
26+-- designed to be: - Simple to use and understand for most users - Flexible
27+-- enough to meet unexpected needs # Overview The \`Status\` message
28+-- contains three pieces of data: error code, error message, and error
29+-- details. The error code should be an enum value of google.rpc.Code, but
30+-- it may accept additional error codes if needed. The error message should
31+-- be a developer-facing English message that helps developers *understand*
32+-- and *resolve* the error. If a localized user-facing error message is
33+-- needed, put the localized message in the error details or localize it in
34+-- the client. The optional error details may contain arbitrary information
35+-- about the error. There is a predefined set of error detail types in the
36+-- package \`google.rpc\` which can be used for common error conditions. #
37+-- Language mapping The \`Status\` message is the logical representation of
38+-- the error model, but it is not necessarily the actual wire format. When
39+-- the \`Status\` message is exposed in different client libraries and
40+-- different wire protocols, it can be mapped differently. For example, it
41+-- will likely be mapped to some exceptions in Java, but more likely mapped
42+-- to some error codes in C. # Other uses The error model and the
43+-- \`Status\` message can be used in a variety of environments, either with
44+-- or without APIs, to provide a consistent developer experience across
45+-- different environments. Example uses of this error model include: -
46+-- Partial errors. If a service needs to return partial errors to the
47+-- client, it may embed the \`Status\` in the normal response to indicate
48+-- the partial errors. - Workflow errors. A typical workflow has multiple
49+-- steps. Each step may have a \`Status\` message for error reporting
50+-- purpose. - Batch operations. If a client uses batch request and batch
51+-- response, the \`Status\` message should be used directly inside batch
52+-- response, one for each error sub-response. - Asynchronous operations. If
53+-- an API call embeds asynchronous operation results in its response, the
54+-- status of those operations should be represented directly using the
55+-- \`Status\` message. - Logging. If some API errors are stored in logs,
56+-- the message \`Status\` could be used directly after any stripping needed
57+-- for security\/privacy reasons.
58+--
59+-- /See:/ 'status' smart constructor.
60+data Status = Status'
61+ { _sDetails :: !(Maybe [StatusDetailsItem])
62+ , _sCode :: !(Maybe (Textual Int32))
63+ , _sMessage :: !(Maybe Text)
64+ } deriving (Eq,Show,Data,Typeable,Generic)
65+
66+-- | Creates a value of 'Status' with the minimum fields required to make a request.
67+--
68+-- Use one of the following lenses to modify other fields as desired:
69+--
70+-- * 'sDetails'
71+--
72+-- * 'sCode'
73+--
74+-- * 'sMessage'
75+status
76+ :: Status
77+status =
78+ Status'
79+ { _sDetails = Nothing
80+ , _sCode = Nothing
81+ , _sMessage = Nothing
82+ }
83+
84+-- | A list of messages that carry the error details. There will be a common
85+-- set of message types for APIs to use.
86+sDetails :: Lens' Status [StatusDetailsItem]
87+sDetails
88+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
89+ _Default
90+ . _Coerce
91+
92+-- | The status code, which should be an enum value of google.rpc.Code.
93+sCode :: Lens' Status (Maybe Int32)
94+sCode
95+ = lens _sCode (\ s a -> s{_sCode = a}) .
96+ mapping _Coerce
97+
98+-- | A developer-facing error message, which should be in English. Any
99+-- user-facing error message should be localized and sent in the
100+-- google.rpc.Status.details field, or localized by the client.
101+sMessage :: Lens' Status (Maybe Text)
102+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
103+
104+instance FromJSON Status where
105+ parseJSON
106+ = withObject "Status"
107+ (\ o ->
108+ Status' <$>
109+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
110+ (o .:? "message"))
111+
112+instance ToJSON Status where
113+ toJSON Status'{..}
114+ = object
115+ (catMaybes
116+ [("details" .=) <$> _sDetails,
117+ ("code" .=) <$> _sCode,
118+ ("message" .=) <$> _sMessage])
119+
120+-- | The request sent to the \`SearchOrganizations\` method.
121+--
122+-- /See:/ 'searchOrganizationsRequest' smart constructor.
123+data SearchOrganizationsRequest = SearchOrganizationsRequest'
124+ { _sorFilter :: !(Maybe Text)
125+ , _sorPageToken :: !(Maybe Text)
126+ , _sorPageSize :: !(Maybe (Textual Int32))
127+ } deriving (Eq,Show,Data,Typeable,Generic)
128+
129+-- | Creates a value of 'SearchOrganizationsRequest' with the minimum fields required to make a request.
130+--
131+-- Use one of the following lenses to modify other fields as desired:
132+--
133+-- * 'sorFilter'
134+--
135+-- * 'sorPageToken'
136+--
137+-- * 'sorPageSize'
138+searchOrganizationsRequest
139+ :: SearchOrganizationsRequest
140+searchOrganizationsRequest =
141+ SearchOrganizationsRequest'
142+ { _sorFilter = Nothing
143+ , _sorPageToken = Nothing
144+ , _sorPageSize = Nothing
145+ }
146+
147+-- | An optional query string used to filter the Organizations to return in
148+-- the response. Filter rules are case-insensitive. Organizations may be
149+-- filtered by \`owner.directoryCustomerId\` or by \`domain\`, where the
150+-- domain is a Google for Work domain, for example: |Filter|Description|
151+-- |------|-----------| |owner.directorycustomerid:123456789|Organizations
152+-- with \`owner.directory_customer_id\` equal to \`123456789\`.|
153+-- |domain:google.com|Organizations corresponding to the domain
154+-- \`google.com\`.| This field is optional.
155+sorFilter :: Lens' SearchOrganizationsRequest (Maybe Text)
156+sorFilter
157+ = lens _sorFilter (\ s a -> s{_sorFilter = a})
158+
159+-- | A pagination token returned from a previous call to
160+-- \`SearchOrganizations\` that indicates from where listing should
161+-- continue. This field is optional.
162+sorPageToken :: Lens' SearchOrganizationsRequest (Maybe Text)
163+sorPageToken
164+ = lens _sorPageToken (\ s a -> s{_sorPageToken = a})
165+
166+-- | The maximum number of Organizations to return in the response. This
167+-- field is optional.
168+sorPageSize :: Lens' SearchOrganizationsRequest (Maybe Int32)
169+sorPageSize
170+ = lens _sorPageSize (\ s a -> s{_sorPageSize = a}) .
171+ mapping _Coerce
172+
173+instance FromJSON SearchOrganizationsRequest where
174+ parseJSON
175+ = withObject "SearchOrganizationsRequest"
176+ (\ o ->
177+ SearchOrganizationsRequest' <$>
178+ (o .:? "filter") <*> (o .:? "pageToken") <*>
179+ (o .:? "pageSize"))
180+
181+instance ToJSON SearchOrganizationsRequest where
182+ toJSON SearchOrganizationsRequest'{..}
183+ = object
184+ (catMaybes
185+ [("filter" .=) <$> _sorFilter,
186+ ("pageToken" .=) <$> _sorPageToken,
187+ ("pageSize" .=) <$> _sorPageSize])
188+
23189-- | A container to reference an id for any resource type. A \`resource\` in
24190-- Google Cloud Platform is a generic term for something you (a developer)
25191-- may want to interact with through one of our API\'s. Some examples are
@@ -151,6 +317,47 @@ instance FromJSON GetIAMPolicyRequest where
151317instance ToJSON GetIAMPolicyRequest where
152318 toJSON = const emptyObject
153319
320+-- | The entity that owns an Organization. The lifetime of the Organization
321+-- and all of its descendants are bound to the \`OrganizationOwner\`. If
322+-- the \`OrganizationOwner\` is deleted, the Organization and all its
323+-- descendants will be deleted.
324+--
325+-- /See:/ 'organizationOwner' smart constructor.
326+newtype OrganizationOwner = OrganizationOwner'
327+ { _ooDirectoryCustomerId :: Maybe Text
328+ } deriving (Eq,Show,Data,Typeable,Generic)
329+
330+-- | Creates a value of 'OrganizationOwner' with the minimum fields required to make a request.
331+--
332+-- Use one of the following lenses to modify other fields as desired:
333+--
334+-- * 'ooDirectoryCustomerId'
335+organizationOwner
336+ :: OrganizationOwner
337+organizationOwner =
338+ OrganizationOwner'
339+ { _ooDirectoryCustomerId = Nothing
340+ }
341+
342+-- | The Google for Work customer id used in the Directory API.
343+ooDirectoryCustomerId :: Lens' OrganizationOwner (Maybe Text)
344+ooDirectoryCustomerId
345+ = lens _ooDirectoryCustomerId
346+ (\ s a -> s{_ooDirectoryCustomerId = a})
347+
348+instance FromJSON OrganizationOwner where
349+ parseJSON
350+ = withObject "OrganizationOwner"
351+ (\ o ->
352+ OrganizationOwner' <$> (o .:? "directoryCustomerId"))
353+
354+instance ToJSON OrganizationOwner where
355+ toJSON OrganizationOwner'{..}
356+ = object
357+ (catMaybes
358+ [("directoryCustomerId" .=) <$>
359+ _ooDirectoryCustomerId])
360+
154361-- | A Project is a high-level Google Cloud Platform entity. It is a
155362-- container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud
156363-- Platform resources.
@@ -210,10 +417,10 @@ pProjectNumber
210417 (\ s a -> s{_pProjectNumber = a})
211418 . mapping _Coerce
212419
213−-- | The user-assigned name of the Project. It must be 4 to 30 characters.
214−-- Allowed characters are: lowercase and uppercase letters, numbers,
215−-- hyphen, single-quote, double-quote, space, and exclamation point.
216−-- Example: My Project Read-write.
420+-- | The user-assigned display name of the Project. It must be 4 to 30
421+-- characters. Allowed characters are: lowercase and uppercase letters,
422+-- numbers, hyphen, single-quote, double-quote, space, and exclamation
423+-- point. Example: My Project Read-write.
217424pName :: Lens' Project (Maybe Text)
218425pName = lens _pName (\ s a -> s{_pName = a})
219426
@@ -271,6 +478,97 @@ instance ToJSON Project where
271478 ("lifecycleState" .=) <$> _pLifecycleState,
272479 ("createTime" .=) <$> _pCreateTime])
273480
481+-- | This resource represents a long-running operation that is the result of
482+-- a network API call.
483+--
484+-- /See:/ 'operation' smart constructor.
485+data Operation = Operation'
486+ { _oDone :: !(Maybe Bool)
487+ , _oError :: !(Maybe Status)
488+ , _oResponse :: !(Maybe OperationResponse)
489+ , _oName :: !(Maybe Text)
490+ , _oMetadata :: !(Maybe OperationMetadata)
491+ } deriving (Eq,Show,Data,Typeable,Generic)
492+
493+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
494+--
495+-- Use one of the following lenses to modify other fields as desired:
496+--
497+-- * 'oDone'
498+--
499+-- * 'oError'
500+--
501+-- * 'oResponse'
502+--
503+-- * 'oName'
504+--
505+-- * 'oMetadata'
506+operation
507+ :: Operation
508+operation =
509+ Operation'
510+ { _oDone = Nothing
511+ , _oError = Nothing
512+ , _oResponse = Nothing
513+ , _oName = Nothing
514+ , _oMetadata = Nothing
515+ }
516+
517+-- | If the value is \`false\`, it means the operation is still in progress.
518+-- If true, the operation is completed, and either \`error\` or
519+-- \`response\` is available.
520+oDone :: Lens' Operation (Maybe Bool)
521+oDone = lens _oDone (\ s a -> s{_oDone = a})
522+
523+-- | The error result of the operation in case of failure.
524+oError :: Lens' Operation (Maybe Status)
525+oError = lens _oError (\ s a -> s{_oError = a})
526+
527+-- | The normal response of the operation in case of success. If the original
528+-- method returns no data on success, such as \`Delete\`, the response is
529+-- \`google.protobuf.Empty\`. If the original method is standard
530+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
531+-- For other methods, the response should have the type \`XxxResponse\`,
532+-- where \`Xxx\` is the original method name. For example, if the original
533+-- method name is \`TakeSnapshot()\`, the inferred response type is
534+-- \`TakeSnapshotResponse\`.
535+oResponse :: Lens' Operation (Maybe OperationResponse)
536+oResponse
537+ = lens _oResponse (\ s a -> s{_oResponse = a})
538+
539+-- | The server-assigned name, which is only unique within the same service
540+-- that originally returns it. If you use the default HTTP mapping, the
541+-- \`name\` should have the format of \`operations\/some\/unique\/name\`.
542+oName :: Lens' Operation (Maybe Text)
543+oName = lens _oName (\ s a -> s{_oName = a})
544+
545+-- | Service-specific metadata associated with the operation. It typically
546+-- contains progress information and common metadata such as create time.
547+-- Some services might not provide such metadata. Any method that returns a
548+-- long-running operation should document the metadata type, if any.
549+oMetadata :: Lens' Operation (Maybe OperationMetadata)
550+oMetadata
551+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
552+
553+instance FromJSON Operation where
554+ parseJSON
555+ = withObject "Operation"
556+ (\ o ->
557+ Operation' <$>
558+ (o .:? "done") <*> (o .:? "error") <*>
559+ (o .:? "response")
560+ <*> (o .:? "name")
561+ <*> (o .:? "metadata"))
562+
563+instance ToJSON Operation where
564+ toJSON Operation'{..}
565+ = object
566+ (catMaybes
567+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
568+ ("response" .=) <$> _oResponse,
569+ ("name" .=) <$> _oName,
570+ ("metadata" .=) <$> _oMetadata])
571+
274572-- | A generic empty message that you can re-use to avoid defining duplicated
275573-- empty messages in your APIs. A typical example is to use it as the
276574-- request or the response type of an API method. For instance: service Foo
@@ -294,6 +592,138 @@ instance FromJSON Empty where
294592instance ToJSON Empty where
295593 toJSON = const emptyObject
296594
595+-- | A status object which is used as the \`metadata\` field for the
596+-- Operation returned by CreateProject. It provides insight for when
597+-- significant phases of Project creation have completed.
598+--
599+-- /See:/ 'projectCreationStatus' smart constructor.
600+data ProjectCreationStatus = ProjectCreationStatus'
601+ { _pcsGettable :: !(Maybe Bool)
602+ , _pcsReady :: !(Maybe Bool)
603+ , _pcsCreateTime :: !(Maybe Text)
604+ } deriving (Eq,Show,Data,Typeable,Generic)
605+
606+-- | Creates a value of 'ProjectCreationStatus' with the minimum fields required to make a request.
607+--
608+-- Use one of the following lenses to modify other fields as desired:
609+--
610+-- * 'pcsGettable'
611+--
612+-- * 'pcsReady'
613+--
614+-- * 'pcsCreateTime'
615+projectCreationStatus
616+ :: ProjectCreationStatus
617+projectCreationStatus =
618+ ProjectCreationStatus'
619+ { _pcsGettable = Nothing
620+ , _pcsReady = Nothing
621+ , _pcsCreateTime = Nothing
622+ }
623+
624+-- | True if the project can be retrieved using GetProject. No other
625+-- operations on the project are guaranteed to work until the project
626+-- creation is complete.
627+pcsGettable :: Lens' ProjectCreationStatus (Maybe Bool)
628+pcsGettable
629+ = lens _pcsGettable (\ s a -> s{_pcsGettable = a})
630+
631+-- | True if the project creation process is complete.
632+pcsReady :: Lens' ProjectCreationStatus (Maybe Bool)
633+pcsReady = lens _pcsReady (\ s a -> s{_pcsReady = a})
634+
635+-- | Creation time of the project creation workflow.
636+pcsCreateTime :: Lens' ProjectCreationStatus (Maybe Text)
637+pcsCreateTime
638+ = lens _pcsCreateTime
639+ (\ s a -> s{_pcsCreateTime = a})
640+
641+instance FromJSON ProjectCreationStatus where
642+ parseJSON
643+ = withObject "ProjectCreationStatus"
644+ (\ o ->
645+ ProjectCreationStatus' <$>
646+ (o .:? "gettable") <*> (o .:? "ready") <*>
647+ (o .:? "createTime"))
648+
649+instance ToJSON ProjectCreationStatus where
650+ toJSON ProjectCreationStatus'{..}
651+ = object
652+ (catMaybes
653+ [("gettable" .=) <$> _pcsGettable,
654+ ("ready" .=) <$> _pcsReady,
655+ ("createTime" .=) <$> _pcsCreateTime])
656+
657+--
658+-- /See:/ 'statusDetailsItem' smart constructor.
659+newtype StatusDetailsItem = StatusDetailsItem'
660+ { _sdiAddtional :: HashMap Text JSONValue
661+ } deriving (Eq,Show,Data,Typeable,Generic)
662+
663+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
664+--
665+-- Use one of the following lenses to modify other fields as desired:
666+--
667+-- * 'sdiAddtional'
668+statusDetailsItem
669+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
670+ -> StatusDetailsItem
671+statusDetailsItem pSdiAddtional_ =
672+ StatusDetailsItem'
673+ { _sdiAddtional = _Coerce # pSdiAddtional_
674+ }
675+
676+-- | Properties of the object. Contains field \'type with type URL.
677+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
678+sdiAddtional
679+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
680+ . _Coerce
681+
682+instance FromJSON StatusDetailsItem where
683+ parseJSON
684+ = withObject "StatusDetailsItem"
685+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
686+
687+instance ToJSON StatusDetailsItem where
688+ toJSON = toJSON . _sdiAddtional
689+
690+-- | A classification of the Folder Operation error.
691+--
692+-- /See:/ 'folderOperationError' smart constructor.
693+newtype FolderOperationError = FolderOperationError'
694+ { _foeErrorMessageId :: Maybe Text
695+ } deriving (Eq,Show,Data,Typeable,Generic)
696+
697+-- | Creates a value of 'FolderOperationError' with the minimum fields required to make a request.
698+--
699+-- Use one of the following lenses to modify other fields as desired:
700+--
701+-- * 'foeErrorMessageId'
702+folderOperationError
703+ :: FolderOperationError
704+folderOperationError =
705+ FolderOperationError'
706+ { _foeErrorMessageId = Nothing
707+ }
708+
709+-- | The type of operation error experienced.
710+foeErrorMessageId :: Lens' FolderOperationError (Maybe Text)
711+foeErrorMessageId
712+ = lens _foeErrorMessageId
713+ (\ s a -> s{_foeErrorMessageId = a})
714+
715+instance FromJSON FolderOperationError where
716+ parseJSON
717+ = withObject "FolderOperationError"
718+ (\ o ->
719+ FolderOperationError' <$> (o .:? "errorMessageId"))
720+
721+instance ToJSON FolderOperationError where
722+ toJSON FolderOperationError'{..}
723+ = object
724+ (catMaybes
725+ [("errorMessageId" .=) <$> _foeErrorMessageId])
726+
297727-- | Request message for \`SetIamPolicy\` method.
298728--
299729-- /See:/ 'setIAMPolicyRequest' smart constructor.
@@ -351,7 +781,8 @@ testIAMPermissionsRequest =
351781
352782-- | The set of permissions to check for the \`resource\`. Permissions with
353783-- wildcards (such as \'*\' or \'storage.*\') are not allowed. For more
354−-- information see IAM Overview.
784+-- information see [IAM
785+-- Overview](https:\/\/cloud.google.com\/iam\/docs\/overview#permissions).
355786tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
356787tiprPermissions
357788 = lens _tiprPermissions
@@ -371,6 +802,63 @@ instance ToJSON TestIAMPermissionsRequest where
371802 = object
372803 (catMaybes [("permissions" .=) <$> _tiprPermissions])
373804
805+-- | The response returned from the \`SearchOrganizations\` method.
806+--
807+-- /See:/ 'searchOrganizationsResponse' smart constructor.
808+data SearchOrganizationsResponse = SearchOrganizationsResponse'
809+ { _sorNextPageToken :: !(Maybe Text)
810+ , _sorOrganizations :: !(Maybe [Organization])
811+ } deriving (Eq,Show,Data,Typeable,Generic)
812+
813+-- | Creates a value of 'SearchOrganizationsResponse' with the minimum fields required to make a request.
814+--
815+-- Use one of the following lenses to modify other fields as desired:
816+--
817+-- * 'sorNextPageToken'
818+--
819+-- * 'sorOrganizations'
820+searchOrganizationsResponse
821+ :: SearchOrganizationsResponse
822+searchOrganizationsResponse =
823+ SearchOrganizationsResponse'
824+ { _sorNextPageToken = Nothing
825+ , _sorOrganizations = Nothing
826+ }
827+
828+-- | A pagination token to be used to retrieve the next page of results. If
829+-- the result is too large to fit within the page size specified in the
830+-- request, this field will be set with a token that can be used to fetch
831+-- the next page of results. If this field is empty, it indicates that this
832+-- response contains the last page of results.
833+sorNextPageToken :: Lens' SearchOrganizationsResponse (Maybe Text)
834+sorNextPageToken
835+ = lens _sorNextPageToken
836+ (\ s a -> s{_sorNextPageToken = a})
837+
838+-- | The list of Organizations that matched the search query, possibly
839+-- paginated.
840+sorOrganizations :: Lens' SearchOrganizationsResponse [Organization]
841+sorOrganizations
842+ = lens _sorOrganizations
843+ (\ s a -> s{_sorOrganizations = a})
844+ . _Default
845+ . _Coerce
846+
847+instance FromJSON SearchOrganizationsResponse where
848+ parseJSON
849+ = withObject "SearchOrganizationsResponse"
850+ (\ o ->
851+ SearchOrganizationsResponse' <$>
852+ (o .:? "nextPageToken") <*>
853+ (o .:? "organizations" .!= mempty))
854+
855+instance ToJSON SearchOrganizationsResponse where
856+ toJSON SearchOrganizationsResponse'{..}
857+ = object
858+ (catMaybes
859+ [("nextPageToken" .=) <$> _sorNextPageToken,
860+ ("organizations" .=) <$> _sorOrganizations])
861+
374862-- | Response message for \`TestIamPermissions\` method.
375863--
376864-- /See:/ 'testIAMPermissionsResponse' smart constructor.
@@ -537,6 +1025,248 @@ instance FromJSON ProjectLabels where
5371025instance ToJSON ProjectLabels where
5381026 toJSON = toJSON . _plAddtional
5391027
1028+-- | Service-specific metadata associated with the operation. It typically
1029+-- contains progress information and common metadata such as create time.
1030+-- Some services might not provide such metadata. Any method that returns a
1031+-- long-running operation should document the metadata type, if any.
1032+--
1033+-- /See:/ 'operationMetadata' smart constructor.
1034+newtype OperationMetadata = OperationMetadata'
1035+ { _omAddtional :: HashMap Text JSONValue
1036+ } deriving (Eq,Show,Data,Typeable,Generic)
1037+
1038+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
1039+--
1040+-- Use one of the following lenses to modify other fields as desired:
1041+--
1042+-- * 'omAddtional'
1043+operationMetadata
1044+ :: HashMap Text JSONValue -- ^ 'omAddtional'
1045+ -> OperationMetadata
1046+operationMetadata pOmAddtional_ =
1047+ OperationMetadata'
1048+ { _omAddtional = _Coerce # pOmAddtional_
1049+ }
1050+
1051+-- | Properties of the object. Contains field \'type with type URL.
1052+omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
1053+omAddtional
1054+ = lens _omAddtional (\ s a -> s{_omAddtional = a}) .
1055+ _Coerce
1056+
1057+instance FromJSON OperationMetadata where
1058+ parseJSON
1059+ = withObject "OperationMetadata"
1060+ (\ o -> OperationMetadata' <$> (parseJSONObject o))
1061+
1062+instance ToJSON OperationMetadata where
1063+ toJSON = toJSON . _omAddtional
1064+
1065+-- | Metadata describing a long running folder operation
1066+--
1067+-- /See:/ 'folderOperation' smart constructor.
1068+data FolderOperation = FolderOperation'
1069+ { _foDestinationParent :: !(Maybe Text)
1070+ , _foDisplayName :: !(Maybe Text)
1071+ , _foOperationType :: !(Maybe Text)
1072+ , _foSourceParent :: !(Maybe Text)
1073+ } deriving (Eq,Show,Data,Typeable,Generic)
1074+
1075+-- | Creates a value of 'FolderOperation' with the minimum fields required to make a request.
1076+--
1077+-- Use one of the following lenses to modify other fields as desired:
1078+--
1079+-- * 'foDestinationParent'
1080+--
1081+-- * 'foDisplayName'
1082+--
1083+-- * 'foOperationType'
1084+--
1085+-- * 'foSourceParent'
1086+folderOperation
1087+ :: FolderOperation
1088+folderOperation =
1089+ FolderOperation'
1090+ { _foDestinationParent = Nothing
1091+ , _foDisplayName = Nothing
1092+ , _foOperationType = Nothing
1093+ , _foSourceParent = Nothing
1094+ }
1095+
1096+-- | The resource name of the folder or organization we are either creating
1097+-- the folder under or moving the folder to.
1098+foDestinationParent :: Lens' FolderOperation (Maybe Text)
1099+foDestinationParent
1100+ = lens _foDestinationParent
1101+ (\ s a -> s{_foDestinationParent = a})
1102+
1103+-- | The display name of the folder.
1104+foDisplayName :: Lens' FolderOperation (Maybe Text)
1105+foDisplayName
1106+ = lens _foDisplayName
1107+ (\ s a -> s{_foDisplayName = a})
1108+
1109+-- | The type of this operation.
1110+foOperationType :: Lens' FolderOperation (Maybe Text)
1111+foOperationType
1112+ = lens _foOperationType
1113+ (\ s a -> s{_foOperationType = a})
1114+
1115+-- | The resource name of the folder\'s parent. Only applicable when the
1116+-- operation_type is MOVE.
1117+foSourceParent :: Lens' FolderOperation (Maybe Text)
1118+foSourceParent
1119+ = lens _foSourceParent
1120+ (\ s a -> s{_foSourceParent = a})
1121+
1122+instance FromJSON FolderOperation where
1123+ parseJSON
1124+ = withObject "FolderOperation"
1125+ (\ o ->
1126+ FolderOperation' <$>
1127+ (o .:? "destinationParent") <*> (o .:? "displayName")
1128+ <*> (o .:? "operationType")
1129+ <*> (o .:? "sourceParent"))
1130+
1131+instance ToJSON FolderOperation where
1132+ toJSON FolderOperation'{..}
1133+ = object
1134+ (catMaybes
1135+ [("destinationParent" .=) <$> _foDestinationParent,
1136+ ("displayName" .=) <$> _foDisplayName,
1137+ ("operationType" .=) <$> _foOperationType,
1138+ ("sourceParent" .=) <$> _foSourceParent])
1139+
1140+-- | The root node in the resource hierarchy to which a particular entity\'s
1141+-- (e.g., company) resources belong.
1142+--
1143+-- /See:/ 'organization' smart constructor.
1144+data Organization = Organization'
1145+ { _orgCreationTime :: !(Maybe Text)
1146+ , _orgOwner :: !(Maybe OrganizationOwner)
1147+ , _orgName :: !(Maybe Text)
1148+ , _orgDisplayName :: !(Maybe Text)
1149+ , _orgLifecycleState :: !(Maybe Text)
1150+ } deriving (Eq,Show,Data,Typeable,Generic)
1151+
1152+-- | Creates a value of 'Organization' with the minimum fields required to make a request.
1153+--
1154+-- Use one of the following lenses to modify other fields as desired:
1155+--
1156+-- * 'orgCreationTime'
1157+--
1158+-- * 'orgOwner'
1159+--
1160+-- * 'orgName'
1161+--
1162+-- * 'orgDisplayName'
1163+--
1164+-- * 'orgLifecycleState'
1165+organization
1166+ :: Organization
1167+organization =
1168+ Organization'
1169+ { _orgCreationTime = Nothing
1170+ , _orgOwner = Nothing
1171+ , _orgName = Nothing
1172+ , _orgDisplayName = Nothing
1173+ , _orgLifecycleState = Nothing
1174+ }
1175+
1176+-- | Timestamp when the Organization was created. Assigned by the server.
1177+-- \'OutputOnly
1178+orgCreationTime :: Lens' Organization (Maybe Text)
1179+orgCreationTime
1180+ = lens _orgCreationTime
1181+ (\ s a -> s{_orgCreationTime = a})
1182+
1183+-- | The owner of this Organization. The owner should be specified on
1184+-- creation. Once set, it cannot be changed. This field is required.
1185+orgOwner :: Lens' Organization (Maybe OrganizationOwner)
1186+orgOwner = lens _orgOwner (\ s a -> s{_orgOwner = a})
1187+
1188+-- | Output Only. The resource name of the organization. This is the
1189+-- organization\'s relative path in the API. Its format is
1190+-- \"organizations\/[organization_id]\". For example,
1191+-- \"organizations\/1234\".
1192+orgName :: Lens' Organization (Maybe Text)
1193+orgName = lens _orgName (\ s a -> s{_orgName = a})
1194+
1195+-- | A friendly string to be used to refer to the Organization in the UI.
1196+-- Assigned by the server, set to the firm name of the Google For Work
1197+-- customer that owns this organization. \'OutputOnly
1198+orgDisplayName :: Lens' Organization (Maybe Text)
1199+orgDisplayName
1200+ = lens _orgDisplayName
1201+ (\ s a -> s{_orgDisplayName = a})
1202+
1203+-- | The organization\'s current lifecycle state. Assigned by the server.
1204+-- \'OutputOnly
1205+orgLifecycleState :: Lens' Organization (Maybe Text)
1206+orgLifecycleState
1207+ = lens _orgLifecycleState
1208+ (\ s a -> s{_orgLifecycleState = a})
1209+
1210+instance FromJSON Organization where
1211+ parseJSON
1212+ = withObject "Organization"
1213+ (\ o ->
1214+ Organization' <$>
1215+ (o .:? "creationTime") <*> (o .:? "owner") <*>
1216+ (o .:? "name")
1217+ <*> (o .:? "displayName")
1218+ <*> (o .:? "lifecycleState"))
1219+
1220+instance ToJSON Organization where
1221+ toJSON Organization'{..}
1222+ = object
1223+ (catMaybes
1224+ [("creationTime" .=) <$> _orgCreationTime,
1225+ ("owner" .=) <$> _orgOwner, ("name" .=) <$> _orgName,
1226+ ("displayName" .=) <$> _orgDisplayName,
1227+ ("lifecycleState" .=) <$> _orgLifecycleState])
1228+
1229+-- | The normal response of the operation in case of success. If the original
1230+-- method returns no data on success, such as \`Delete\`, the response is
1231+-- \`google.protobuf.Empty\`. If the original method is standard
1232+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
1233+-- For other methods, the response should have the type \`XxxResponse\`,
1234+-- where \`Xxx\` is the original method name. For example, if the original
1235+-- method name is \`TakeSnapshot()\`, the inferred response type is
1236+-- \`TakeSnapshotResponse\`.
1237+--
1238+-- /See:/ 'operationResponse' smart constructor.
1239+newtype OperationResponse = OperationResponse'
1240+ { _orAddtional :: HashMap Text JSONValue
1241+ } deriving (Eq,Show,Data,Typeable,Generic)
1242+
1243+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
1244+--
1245+-- Use one of the following lenses to modify other fields as desired:
1246+--
1247+-- * 'orAddtional'
1248+operationResponse
1249+ :: HashMap Text JSONValue -- ^ 'orAddtional'
1250+ -> OperationResponse
1251+operationResponse pOrAddtional_ =
1252+ OperationResponse'
1253+ { _orAddtional = _Coerce # pOrAddtional_
1254+ }
1255+
1256+-- | Properties of the object. Contains field \'type with type URL.
1257+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
1258+orAddtional
1259+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
1260+ _Coerce
1261+
1262+instance FromJSON OperationResponse where
1263+ parseJSON
1264+ = withObject "OperationResponse"
1265+ (\ o -> OperationResponse' <$> (parseJSONObject o))
1266+
1267+instance ToJSON OperationResponse where
1268+ toJSON = toJSON . _orAddtional
1269+
5401270-- | The request sent to the UndeleteProject method.
5411271--
5421272-- /See:/ 'undeleteProjectRequest' smart constructor.