Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR apimanagement/resource-manager] Revert not support formats xml-link and rawxml-link #4959

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ class NotificationName(str, Enum):
class PolicyExportFormat(str, Enum):

xml = "xml" #: The contents are inline and Content type is an XML document.
xml_link = "xml-link" #: The policy XML document is exported to a storage blob with SAS key valid for 5 minutes.
rawxml = "rawxml" #: The contents are inline and Content type is a non XML encoded policy document.
rawxml_link = "rawxml-link" #: The policy document is not XML encoded is exported to a storage blob with SAS Key valid for 5 minutes.


class TemplateName(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def list_by_operation(
list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies'}

def get_entity_tag(
self, resource_group_name, service_name, api_id, operation_id, format="xml", custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config):
"""Gets the entity state (Etag) version of the API operation policy
specified by its identifier.

Expand All @@ -124,10 +124,6 @@ def get_entity_tag(
:param operation_id: Operation identifier within an API. Must be
unique in the current API Management service instance.
:type operation_id: str
:param format: Policy Export Format. Possible values include: 'xml',
'xml-link', 'rawxml', 'rawxml-link'
:type format: str or
~azure.mgmt.apimanagement.models.PolicyExportFormat
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -152,8 +148,6 @@ def get_entity_tag(

# Construct parameters
query_parameters = {}
if format is not None:
query_parameters['format'] = self._serialize.query("format", format, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
Expand Down Expand Up @@ -181,7 +175,7 @@ def get_entity_tag(
get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'}

def get(
self, resource_group_name, service_name, api_id, operation_id, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, service_name, api_id, operation_id, format="xml", custom_headers=None, raw=False, **operation_config):
"""Get the policy configuration at the API Operation level.

:param resource_group_name: The name of the resource group.
Expand All @@ -195,6 +189,10 @@ def get(
:param operation_id: Operation identifier within an API. Must be
unique in the current API Management service instance.
:type operation_id: str
:param format: Policy Export Format. Possible values include: 'xml',
'rawxml'
:type format: str or
~azure.mgmt.apimanagement.models.PolicyExportFormat
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -220,6 +218,8 @@ def get(

# Construct parameters
query_parameters = {}
if format is not None:
query_parameters['format'] = self._serialize.query("format", format, 'str')
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def get(
suffix where n is the revision number.
:type api_id: str
:param format: Policy Export Format. Possible values include: 'xml',
'xml-link', 'rawxml', 'rawxml-link'
'rawxml'
:type format: str or
~azure.mgmt.apimanagement.models.PolicyExportFormat
:param dict custom_headers: headers that will be added to the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get(
:param service_name: The name of the API Management service.
:type service_name: str
:param format: Policy Export Format. Possible values include: 'xml',
'xml-link', 'rawxml', 'rawxml-link'
'rawxml'
:type format: str or
~azure.mgmt.apimanagement.models.PolicyExportFormat
:param dict custom_headers: headers that will be added to the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def get(
API Management service instance.
:type product_id: str
:param format: Policy Export Format. Possible values include: 'xml',
'xml-link', 'rawxml', 'rawxml-link'
'rawxml'
:type format: str or
~azure.mgmt.apimanagement.models.PolicyExportFormat
:param dict custom_headers: headers that will be added to the request
Expand Down