From ea6973d5cffb74d2413db81a9322c1ef40c60e3c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 11 Oct 2018 18:21:10 +0000 Subject: [PATCH] Generated from b2f02dca5d73046118161dec67291827b68642b2 Add graphrbac/data-plane/readme.typescript.md --- .../operations/applications_operations.py | 53 +++++++++++++++++++ .../graphrbac/operations/groups_operations.py | 53 +++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/azure-graphrbac/azure/graphrbac/operations/applications_operations.py b/azure-graphrbac/azure/graphrbac/operations/applications_operations.py index 25750b9a580e..7740b9d7e6d3 100644 --- a/azure-graphrbac/azure/graphrbac/operations/applications_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/applications_operations.py @@ -467,6 +467,59 @@ def add_owner( return client_raw_response add_owner.metadata = {'url': '/{tenantID}/applications/{applicationObjectId}/$links/owners'} + def remove_owner( + self, application_object_id, owner_object_id, custom_headers=None, raw=False, **operation_config): + """Remove a member from owners. + + :param application_object_id: The object ID of the application from + which to remove the owner. + :type application_object_id: str + :param owner_object_id: Owner object id + :type owner_object_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`GraphErrorException` + """ + # Construct URL + url = self.remove_owner.metadata['url'] + path_format_arguments = { + 'applicationObjectId': self._serialize.url("application_object_id", application_object_id, 'str'), + 'ownerObjectId': self._serialize.url("owner_object_id", owner_object_id, 'str'), + 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.GraphErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + remove_owner.metadata = {'url': '/{tenantID}/applications/{applicationObjectId}/$links/owners/{ownerObjectId}'} + def list_key_credentials( self, application_object_id, custom_headers=None, raw=False, **operation_config): """Get the keyCredentials associated with an application. diff --git a/azure-graphrbac/azure/graphrbac/operations/groups_operations.py b/azure-graphrbac/azure/graphrbac/operations/groups_operations.py index 52e7f22d8378..c9f18954ebe6 100644 --- a/azure-graphrbac/azure/graphrbac/operations/groups_operations.py +++ b/azure-graphrbac/azure/graphrbac/operations/groups_operations.py @@ -745,3 +745,56 @@ def add_owner( client_raw_response = ClientRawResponse(None, response) return client_raw_response add_owner.metadata = {'url': '/{tenantID}/groups/{objectId}/$links/owners'} + + def remove_owner( + self, object_id, owner_object_id, custom_headers=None, raw=False, **operation_config): + """Remove a member from owners. + + :param object_id: The object ID of the group from which to remove the + owner. + :type object_id: str + :param owner_object_id: Owner object id + :type owner_object_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`GraphErrorException` + """ + # Construct URL + url = self.remove_owner.metadata['url'] + path_format_arguments = { + 'objectId': self._serialize.url("object_id", object_id, 'str'), + 'ownerObjectId': self._serialize.url("owner_object_id", owner_object_id, 'str'), + 'tenantID': self._serialize.url("self.config.tenant_id", self.config.tenant_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.GraphErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + remove_owner.metadata = {'url': '/{tenantID}/groups/{objectId}/$links/owners/{ownerObjectId}'}