@@ -20,6 +20,172 @@ module Network.Google.ResourceManager.Types.Product where
20import Network.Google.Prelude
20import Network.Google.Prelude
21import Network.Google.ResourceManager.Types.Sum
21import Network.Google.ResourceManager.Types.Sum
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.
59+-- /See:/ 'status' smart constructor.
61+ { _sDetails :: !(Maybe [StatusDetailsItem])
62+ , _sCode :: !(Maybe (Textual Int32))
63+ , _sMessage :: !(Maybe Text)
64+ } deriving (Eq,Show,Data,Typeable,Generic)
66+-- | Creates a value of 'Status' with the minimum fields required to make a request.
68+-- Use one of the following lenses to modify other fields as desired:
79+ { _sDetails = Nothing
81+ , _sMessage = Nothing
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]
88+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
92+-- | The status code, which should be an enum value of google.rpc.Code.
93+sCode :: Lens' Status (Maybe Int32)
95+ = lens _sCode (\ s a -> s{_sCode = a}) .
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})
104+instance FromJSON Status where
106+ = withObject "Status"
109+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
112+instance ToJSON Status where
116+ [("details" .=) <$> _sDetails,
117+ ("code" .=) <$> _sCode,
118+ ("message" .=) <$> _sMessage])
120+-- | The request sent to the \`SearchOrganizations\` method.
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)
129+-- | Creates a value of 'SearchOrganizationsRequest' with the minimum fields required to make a request.
131+-- Use one of the following lenses to modify other fields as desired:
138+searchOrganizationsRequest
139+ :: SearchOrganizationsRequest
140+searchOrganizationsRequest =
141+ SearchOrganizationsRequest'
142+ { _sorFilter = Nothing
143+ , _sorPageToken = Nothing
144+ , _sorPageSize = Nothing
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)
157+ = lens _sorFilter (\ s a -> s{_sorFilter = a})
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)
164+ = lens _sorPageToken (\ s a -> s{_sorPageToken = a})
166+-- | The maximum number of Organizations to return in the response. This
167+-- field is optional.
168+sorPageSize :: Lens' SearchOrganizationsRequest (Maybe Int32)
170+ = lens _sorPageSize (\ s a -> s{_sorPageSize = a}) .
173+instance FromJSON SearchOrganizationsRequest where
175+ = withObject "SearchOrganizationsRequest"
177+ SearchOrganizationsRequest' <$>
178+ (o .:? "filter") <*> (o .:? "pageToken") <*>
181+instance ToJSON SearchOrganizationsRequest where
182+ toJSON SearchOrganizationsRequest'{..}
185+ [("filter" .=) <$> _sorFilter,
186+ ("pageToken" .=) <$> _sorPageToken,
187+ ("pageSize" .=) <$> _sorPageSize])
23-- | A container to reference an id for any resource type. A \`resource\` in
189-- | A container to reference an id for any resource type. A \`resource\` in
24-- Google Cloud Platform is a generic term for something you (a developer)
190-- Google Cloud Platform is a generic term for something you (a developer)
25-- may want to interact with through one of our API\'s. Some examples are
191-- may want to interact with through one of our API\'s. Some examples are
@@ -151,6 +317,47 @@ instance FromJSON GetIAMPolicyRequest where
151instance ToJSON GetIAMPolicyRequest where
317instance ToJSON GetIAMPolicyRequest where
152 toJSON = const emptyObject
318 toJSON = const emptyObject
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.
325+-- /See:/ 'organizationOwner' smart constructor.
326+newtype OrganizationOwner = OrganizationOwner'
327+ { _ooDirectoryCustomerId :: Maybe Text
328+ } deriving (Eq,Show,Data,Typeable,Generic)
330+-- | Creates a value of 'OrganizationOwner' with the minimum fields required to make a request.
332+-- Use one of the following lenses to modify other fields as desired:
334+-- * 'ooDirectoryCustomerId'
336+ :: OrganizationOwner
339+ { _ooDirectoryCustomerId = Nothing
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})
348+instance FromJSON OrganizationOwner where
350+ = withObject "OrganizationOwner"
352+ OrganizationOwner' <$> (o .:? "directoryCustomerId"))
354+instance ToJSON OrganizationOwner where
355+ toJSON OrganizationOwner'{..}
358+ [("directoryCustomerId" .=) <$>
359+ _ooDirectoryCustomerId])
154-- | A Project is a high-level Google Cloud Platform entity. It is a
361-- | A Project is a high-level Google Cloud Platform entity. It is a
155-- container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud
362-- container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud
156-- Platform resources.
363-- Platform resources.
@@ -210,10 +417,10 @@ pProjectNumber
210 (\ s a -> s{_pProjectNumber = a})
417 (\ s a -> s{_pProjectNumber = a})
211 . mapping _Coerce
418 . mapping _Coerce
213−-- | The user-assigned name of the Project. It must be 4 to 30 characters.
420+-- | The user-assigned display name of the Project. It must be 4 to 30
214−-- Allowed characters are: lowercase and uppercase letters, numbers,
421+-- characters. Allowed characters are: lowercase and uppercase letters,
215−-- hyphen, single-quote, double-quote, space, and exclamation point.
422+-- numbers, hyphen, single-quote, double-quote, space, and exclamation
216−-- Example: My Project Read-write.
423+-- point. Example: My Project Read-write.
217pName :: Lens' Project (Maybe Text)
424pName :: Lens' Project (Maybe Text)
218pName = lens _pName (\ s a -> s{_pName = a})
425pName = lens _pName (\ s a -> s{_pName = a})
@@ -271,6 +478,97 @@ instance ToJSON Project where
271 ("lifecycleState" .=) <$> _pLifecycleState,
478 ("lifecycleState" .=) <$> _pLifecycleState,
272 ("createTime" .=) <$> _pCreateTime])
479 ("createTime" .=) <$> _pCreateTime])
481+-- | This resource represents a long-running operation that is the result of
482+-- a network API call.
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)
493+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
495+-- Use one of the following lenses to modify other fields as desired:
512+ , _oResponse = Nothing
514+ , _oMetadata = Nothing
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})
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})
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)
537+ = lens _oResponse (\ s a -> s{_oResponse = a})
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})
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)
551+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
553+instance FromJSON Operation where
555+ = withObject "Operation"
558+ (o .:? "done") <*> (o .:? "error") <*>
561+ <*> (o .:? "metadata"))
563+instance ToJSON Operation where
564+ toJSON Operation'{..}
567+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
568+ ("response" .=) <$> _oResponse,
569+ ("name" .=) <$> _oName,
570+ ("metadata" .=) <$> _oMetadata])
274-- | A generic empty message that you can re-use to avoid defining duplicated
572-- | A generic empty message that you can re-use to avoid defining duplicated
275-- empty messages in your APIs. A typical example is to use it as the
573-- empty messages in your APIs. A typical example is to use it as the
276-- request or the response type of an API method. For instance: service Foo
574-- request or the response type of an API method. For instance: service Foo
@@ -294,6 +592,138 @@ instance FromJSON Empty where
294instance ToJSON Empty where
592instance ToJSON Empty where
295 toJSON = const emptyObject
593 toJSON = const emptyObject
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.
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)
606+-- | Creates a value of 'ProjectCreationStatus' with the minimum fields required to make a request.
608+-- Use one of the following lenses to modify other fields as desired:
615+projectCreationStatus
616+ :: ProjectCreationStatus
617+projectCreationStatus =
618+ ProjectCreationStatus'
619+ { _pcsGettable = Nothing
620+ , _pcsReady = Nothing
621+ , _pcsCreateTime = Nothing
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)
629+ = lens _pcsGettable (\ s a -> s{_pcsGettable = a})
631+-- | True if the project creation process is complete.
632+pcsReady :: Lens' ProjectCreationStatus (Maybe Bool)
633+pcsReady = lens _pcsReady (\ s a -> s{_pcsReady = a})
635+-- | Creation time of the project creation workflow.
636+pcsCreateTime :: Lens' ProjectCreationStatus (Maybe Text)
638+ = lens _pcsCreateTime
639+ (\ s a -> s{_pcsCreateTime = a})
641+instance FromJSON ProjectCreationStatus where
643+ = withObject "ProjectCreationStatus"
645+ ProjectCreationStatus' <$>
646+ (o .:? "gettable") <*> (o .:? "ready") <*>
647+ (o .:? "createTime"))
649+instance ToJSON ProjectCreationStatus where
650+ toJSON ProjectCreationStatus'{..}
653+ [("gettable" .=) <$> _pcsGettable,
654+ ("ready" .=) <$> _pcsReady,
655+ ("createTime" .=) <$> _pcsCreateTime])
658+-- /See:/ 'statusDetailsItem' smart constructor.
659+newtype StatusDetailsItem = StatusDetailsItem'
660+ { _sdiAddtional :: HashMap Text JSONValue
661+ } deriving (Eq,Show,Data,Typeable,Generic)
663+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
665+-- Use one of the following lenses to modify other fields as desired:
669+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
670+ -> StatusDetailsItem
671+statusDetailsItem pSdiAddtional_ =
673+ { _sdiAddtional = _Coerce # pSdiAddtional_
676+-- | Properties of the object. Contains field \'type with type URL.
677+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
679+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
682+instance FromJSON StatusDetailsItem where
684+ = withObject "StatusDetailsItem"
685+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
687+instance ToJSON StatusDetailsItem where
688+ toJSON = toJSON . _sdiAddtional
690+-- | A classification of the Folder Operation error.
692+-- /See:/ 'folderOperationError' smart constructor.
693+newtype FolderOperationError = FolderOperationError'
694+ { _foeErrorMessageId :: Maybe Text
695+ } deriving (Eq,Show,Data,Typeable,Generic)
697+-- | Creates a value of 'FolderOperationError' with the minimum fields required to make a request.
699+-- Use one of the following lenses to modify other fields as desired:
701+-- * 'foeErrorMessageId'
703+ :: FolderOperationError
704+folderOperationError =
705+ FolderOperationError'
706+ { _foeErrorMessageId = Nothing
709+-- | The type of operation error experienced.
710+foeErrorMessageId :: Lens' FolderOperationError (Maybe Text)
712+ = lens _foeErrorMessageId
713+ (\ s a -> s{_foeErrorMessageId = a})
715+instance FromJSON FolderOperationError where
717+ = withObject "FolderOperationError"
719+ FolderOperationError' <$> (o .:? "errorMessageId"))
721+instance ToJSON FolderOperationError where
722+ toJSON FolderOperationError'{..}
725+ [("errorMessageId" .=) <$> _foeErrorMessageId])
297-- | Request message for \`SetIamPolicy\` method.
727-- | Request message for \`SetIamPolicy\` method.
299-- /See:/ 'setIAMPolicyRequest' smart constructor.
729-- /See:/ 'setIAMPolicyRequest' smart constructor.
@@ -351,7 +781,8 @@ testIAMPermissionsRequest =
352-- | The set of permissions to check for the \`resource\`. Permissions with
782-- | The set of permissions to check for the \`resource\`. Permissions with
353-- wildcards (such as \'*\' or \'storage.*\') are not allowed. For more
783-- 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).
355tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
786tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
356tiprPermissions
787tiprPermissions
357 = lens _tiprPermissions
788 = lens _tiprPermissions
@@ -371,6 +802,63 @@ instance ToJSON TestIAMPermissionsRequest where
372 (catMaybes [("permissions" .=) <$> _tiprPermissions])
803 (catMaybes [("permissions" .=) <$> _tiprPermissions])
805+-- | The response returned from the \`SearchOrganizations\` method.
807+-- /See:/ 'searchOrganizationsResponse' smart constructor.
808+data SearchOrganizationsResponse = SearchOrganizationsResponse'
809+ { _sorNextPageToken :: !(Maybe Text)
810+ , _sorOrganizations :: !(Maybe [Organization])
811+ } deriving (Eq,Show,Data,Typeable,Generic)
813+-- | Creates a value of 'SearchOrganizationsResponse' with the minimum fields required to make a request.
815+-- Use one of the following lenses to modify other fields as desired:
817+-- * 'sorNextPageToken'
819+-- * 'sorOrganizations'
820+searchOrganizationsResponse
821+ :: SearchOrganizationsResponse
822+searchOrganizationsResponse =
823+ SearchOrganizationsResponse'
824+ { _sorNextPageToken = Nothing
825+ , _sorOrganizations = Nothing
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)
835+ = lens _sorNextPageToken
836+ (\ s a -> s{_sorNextPageToken = a})
838+-- | The list of Organizations that matched the search query, possibly
840+sorOrganizations :: Lens' SearchOrganizationsResponse [Organization]
842+ = lens _sorOrganizations
843+ (\ s a -> s{_sorOrganizations = a})
847+instance FromJSON SearchOrganizationsResponse where
849+ = withObject "SearchOrganizationsResponse"
851+ SearchOrganizationsResponse' <$>
852+ (o .:? "nextPageToken") <*>
853+ (o .:? "organizations" .!= mempty))
855+instance ToJSON SearchOrganizationsResponse where
856+ toJSON SearchOrganizationsResponse'{..}
859+ [("nextPageToken" .=) <$> _sorNextPageToken,
860+ ("organizations" .=) <$> _sorOrganizations])
374-- | Response message for \`TestIamPermissions\` method.
862-- | Response message for \`TestIamPermissions\` method.
376-- /See:/ 'testIAMPermissionsResponse' smart constructor.
864-- /See:/ 'testIAMPermissionsResponse' smart constructor.
@@ -537,6 +1025,248 @@ instance FromJSON ProjectLabels where
537instance ToJSON ProjectLabels where
1025instance ToJSON ProjectLabels where
538 toJSON = toJSON . _plAddtional
1026 toJSON = toJSON . _plAddtional
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.
1033+-- /See:/ 'operationMetadata' smart constructor.
1034+newtype OperationMetadata = OperationMetadata'
1035+ { _omAddtional :: HashMap Text JSONValue
1036+ } deriving (Eq,Show,Data,Typeable,Generic)
1038+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
1040+-- Use one of the following lenses to modify other fields as desired:
1044+ :: HashMap Text JSONValue -- ^ 'omAddtional'
1045+ -> OperationMetadata
1046+operationMetadata pOmAddtional_ =
1048+ { _omAddtional = _Coerce # pOmAddtional_
1051+-- | Properties of the object. Contains field \'type with type URL.
1052+omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
1054+ = lens _omAddtional (\ s a -> s{_omAddtional = a}) .
1057+instance FromJSON OperationMetadata where
1059+ = withObject "OperationMetadata"
1060+ (\ o -> OperationMetadata' <$> (parseJSONObject o))
1062+instance ToJSON OperationMetadata where
1063+ toJSON = toJSON . _omAddtional
1065+-- | Metadata describing a long running folder operation
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)
1075+-- | Creates a value of 'FolderOperation' with the minimum fields required to make a request.
1077+-- Use one of the following lenses to modify other fields as desired:
1079+-- * 'foDestinationParent'
1081+-- * 'foDisplayName'
1083+-- * 'foOperationType'
1085+-- * 'foSourceParent'
1090+ { _foDestinationParent = Nothing
1091+ , _foDisplayName = Nothing
1092+ , _foOperationType = Nothing
1093+ , _foSourceParent = Nothing
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)
1100+ = lens _foDestinationParent
1101+ (\ s a -> s{_foDestinationParent = a})
1103+-- | The display name of the folder.
1104+foDisplayName :: Lens' FolderOperation (Maybe Text)
1106+ = lens _foDisplayName
1107+ (\ s a -> s{_foDisplayName = a})
1109+-- | The type of this operation.
1110+foOperationType :: Lens' FolderOperation (Maybe Text)
1112+ = lens _foOperationType
1113+ (\ s a -> s{_foOperationType = a})
1115+-- | The resource name of the folder\'s parent. Only applicable when the
1116+-- operation_type is MOVE.
1117+foSourceParent :: Lens' FolderOperation (Maybe Text)
1119+ = lens _foSourceParent
1120+ (\ s a -> s{_foSourceParent = a})
1122+instance FromJSON FolderOperation where
1124+ = withObject "FolderOperation"
1126+ FolderOperation' <$>
1127+ (o .:? "destinationParent") <*> (o .:? "displayName")
1128+ <*> (o .:? "operationType")
1129+ <*> (o .:? "sourceParent"))
1131+instance ToJSON FolderOperation where
1132+ toJSON FolderOperation'{..}
1135+ [("destinationParent" .=) <$> _foDestinationParent,
1136+ ("displayName" .=) <$> _foDisplayName,
1137+ ("operationType" .=) <$> _foOperationType,
1138+ ("sourceParent" .=) <$> _foSourceParent])
1140+-- | The root node in the resource hierarchy to which a particular entity\'s
1141+-- (e.g., company) resources belong.
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)
1152+-- | Creates a value of 'Organization' with the minimum fields required to make a request.
1154+-- Use one of the following lenses to modify other fields as desired:
1156+-- * 'orgCreationTime'
1162+-- * 'orgDisplayName'
1164+-- * 'orgLifecycleState'
1169+ { _orgCreationTime = Nothing
1170+ , _orgOwner = Nothing
1171+ , _orgName = Nothing
1172+ , _orgDisplayName = Nothing
1173+ , _orgLifecycleState = Nothing
1176+-- | Timestamp when the Organization was created. Assigned by the server.
1178+orgCreationTime :: Lens' Organization (Maybe Text)
1180+ = lens _orgCreationTime
1181+ (\ s a -> s{_orgCreationTime = a})
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})
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})
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)
1200+ = lens _orgDisplayName
1201+ (\ s a -> s{_orgDisplayName = a})
1203+-- | The organization\'s current lifecycle state. Assigned by the server.
1205+orgLifecycleState :: Lens' Organization (Maybe Text)
1207+ = lens _orgLifecycleState
1208+ (\ s a -> s{_orgLifecycleState = a})
1210+instance FromJSON Organization where
1212+ = withObject "Organization"
1215+ (o .:? "creationTime") <*> (o .:? "owner") <*>
1217+ <*> (o .:? "displayName")
1218+ <*> (o .:? "lifecycleState"))
1220+instance ToJSON Organization where
1221+ toJSON Organization'{..}
1224+ [("creationTime" .=) <$> _orgCreationTime,
1225+ ("owner" .=) <$> _orgOwner, ("name" .=) <$> _orgName,
1226+ ("displayName" .=) <$> _orgDisplayName,
1227+ ("lifecycleState" .=) <$> _orgLifecycleState])
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\`.
1238+-- /See:/ 'operationResponse' smart constructor.
1239+newtype OperationResponse = OperationResponse'
1240+ { _orAddtional :: HashMap Text JSONValue
1241+ } deriving (Eq,Show,Data,Typeable,Generic)
1243+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
1245+-- Use one of the following lenses to modify other fields as desired:
1249+ :: HashMap Text JSONValue -- ^ 'orAddtional'
1250+ -> OperationResponse
1251+operationResponse pOrAddtional_ =
1253+ { _orAddtional = _Coerce # pOrAddtional_
1256+-- | Properties of the object. Contains field \'type with type URL.
1257+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
1259+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
1262+instance FromJSON OperationResponse where
1264+ = withObject "OperationResponse"
1265+ (\ o -> OperationResponse' <$> (parseJSONObject o))
1267+instance ToJSON OperationResponse where
1268+ toJSON = toJSON . _orAddtional
540-- | The request sent to the UndeleteProject method.
1270-- | The request sent to the UndeleteProject method.
542-- /See:/ 'undeleteProjectRequest' smart constructor.
1272-- /See:/ 'undeleteProjectRequest' smart constructor.