Skip to content

Commit

Permalink
CodeGen from PR 16455 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.Security to add version preview/2021-07-01-preview (Azure#16455)

* .

* .
  • Loading branch information
SDKAuto committed Oct 20, 2021
1 parent e4c21c4 commit df614df
Show file tree
Hide file tree
Showing 25 changed files with 3,584 additions and 234 deletions.
2 changes: 1 addition & 1 deletion sdk/security/azure-mgmt-security/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "a8719243647b7c6d06ed287483d788808de7ecab",
"commit": "d5efa33977334c2736dacab9f75740ab8dcbc4c6",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/security/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
"readme": "specification/security/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "",
"total_api_version_list": ["2015-06-01-preview", "2017-08-01", "2017-08-01-preview", "2018-06-01", "2019-01-01", "2019-01-01-preview", "2019-08-01", "2020-01-01", "2020-01-01-preview", "2020-07-01-preview", "2021-01-01", "2021-01-15-preview", "2021-05-01-preview", "2021-07-01"],
"total_api_version_list": ["2015-06-01-preview", "2017-08-01", "2017-08-01-preview", "2018-06-01", "2019-01-01", "2019-01-01-preview", "2019-08-01", "2020-01-01", "2020-01-01-preview", "2020-07-01-preview", "2021-01-01", "2021-01-15-preview", "2021-05-01-preview", "2021-06-01", "2021-07-01", "2021-07-01-preview"],
"client": {
"name": "SecurityCenter",
"filename": "_security_center",
Expand Down Expand Up @@ -110,6 +110,8 @@
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"custom_assessment_automations": "CustomAssessmentAutomationsOperations",
"custom_entity_store_assignments": "CustomEntityStoreAssignmentsOperations",
"compliance_results": "ComplianceResultsOperations",
"pricings": "PricingsOperations",
"advanced_threat_protection": "AdvancedThreatProtectionOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import SecurityCenterConfiguration
from .operations import CustomAssessmentAutomationsOperations
from .operations import CustomEntityStoreAssignmentsOperations
from .operations import ComplianceResultsOperations
from .operations import PricingsOperations
from .operations import AdvancedThreatProtectionOperations
Expand Down Expand Up @@ -70,6 +72,10 @@
class SecurityCenter(object):
"""API spec for Microsoft.Security (Azure Security Center) resource provider.
:ivar custom_assessment_automations: CustomAssessmentAutomationsOperations operations
:vartype custom_assessment_automations: azure.mgmt.security.operations.CustomAssessmentAutomationsOperations
:ivar custom_entity_store_assignments: CustomEntityStoreAssignmentsOperations operations
:vartype custom_entity_store_assignments: azure.mgmt.security.operations.CustomEntityStoreAssignmentsOperations
:ivar compliance_results: ComplianceResultsOperations operations
:vartype compliance_results: azure.mgmt.security.operations.ComplianceResultsOperations
:ivar pricings: PricingsOperations operations
Expand Down Expand Up @@ -189,6 +195,10 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.custom_assessment_automations = CustomAssessmentAutomationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.custom_entity_store_assignments = CustomEntityStoreAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.compliance_results = ComplianceResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.pricings = PricingsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import SecurityCenterConfiguration
from .operations import CustomAssessmentAutomationsOperations
from .operations import CustomEntityStoreAssignmentsOperations
from .operations import ComplianceResultsOperations
from .operations import PricingsOperations
from .operations import AdvancedThreatProtectionOperations
Expand Down Expand Up @@ -68,6 +70,10 @@
class SecurityCenter(object):
"""API spec for Microsoft.Security (Azure Security Center) resource provider.
:ivar custom_assessment_automations: CustomAssessmentAutomationsOperations operations
:vartype custom_assessment_automations: azure.mgmt.security.aio.operations.CustomAssessmentAutomationsOperations
:ivar custom_entity_store_assignments: CustomEntityStoreAssignmentsOperations operations
:vartype custom_entity_store_assignments: azure.mgmt.security.aio.operations.CustomEntityStoreAssignmentsOperations
:ivar compliance_results: ComplianceResultsOperations operations
:vartype compliance_results: azure.mgmt.security.aio.operations.ComplianceResultsOperations
:ivar pricings: PricingsOperations operations
Expand Down Expand Up @@ -186,6 +192,10 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.custom_assessment_automations = CustomAssessmentAutomationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.custom_entity_store_assignments = CustomEntityStoreAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.compliance_results = ComplianceResultsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.pricings = PricingsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._custom_assessment_automations_operations import CustomAssessmentAutomationsOperations
from ._custom_entity_store_assignments_operations import CustomEntityStoreAssignmentsOperations
from ._compliance_results_operations import ComplianceResultsOperations
from ._pricings_operations import PricingsOperations
from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations
Expand Down Expand Up @@ -53,6 +55,8 @@
from ._software_inventories_operations import SoftwareInventoriesOperations

__all__ = [
'CustomAssessmentAutomationsOperations',
'CustomEntityStoreAssignmentsOperations',
'ComplianceResultsOperations',
'PricingsOperations',
'AdvancedThreatProtectionOperations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list(
self,
**kwargs: Any
) -> AsyncIterable["_models.SecurityAssessmentMetadataList"]:
) -> AsyncIterable["_models.SecurityAssessmentMetadataResponseList"]:
"""Get metadata information on all assessment types.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList]
:return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand All @@ -80,7 +80,7 @@ def prepare_request(next_link=None):
return request

async def extract_data(pipeline_response):
deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response)
deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
Expand All @@ -107,22 +107,22 @@ async def get(
self,
assessment_metadata_name: str,
**kwargs: Any
) -> "_models.SecurityAssessmentMetadata":
) -> "_models.SecurityAssessmentMetadataResponse":
"""Get metadata information on an assessment type.
:param assessment_metadata_name: The Assessment Key - Unique key for the assessment type.
:type assessment_metadata_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityAssessmentMetadata, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata
:return: SecurityAssessmentMetadataResponse, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
accept = "application/json"

# Construct URL
Expand All @@ -148,7 +148,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response)
deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})
Expand All @@ -159,20 +159,20 @@ async def get(
def list_by_subscription(
self,
**kwargs: Any
) -> AsyncIterable["_models.SecurityAssessmentMetadataList"]:
) -> AsyncIterable["_models.SecurityAssessmentMetadataResponseList"]:
"""Get metadata information on all assessment types in a specific subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList]
:return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand All @@ -199,7 +199,7 @@ def prepare_request(next_link=None):
return request

async def extract_data(pipeline_response):
deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response)
deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
Expand All @@ -226,22 +226,22 @@ async def get_in_subscription(
self,
assessment_metadata_name: str,
**kwargs: Any
) -> "_models.SecurityAssessmentMetadata":
) -> "_models.SecurityAssessmentMetadataResponse":
"""Get metadata information on an assessment type in a specific subscription.
:param assessment_metadata_name: The Assessment Key - Unique key for the assessment type.
:type assessment_metadata_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityAssessmentMetadata, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata
:return: SecurityAssessmentMetadataResponse, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
accept = "application/json"

# Construct URL
Expand All @@ -268,7 +268,7 @@ async def get_in_subscription(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response)
deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})
Expand All @@ -279,26 +279,26 @@ async def get_in_subscription(
async def create_in_subscription(
self,
assessment_metadata_name: str,
assessment_metadata: "_models.SecurityAssessmentMetadata",
assessment_metadata: "_models.SecurityAssessmentMetadataResponse",
**kwargs: Any
) -> "_models.SecurityAssessmentMetadata":
) -> "_models.SecurityAssessmentMetadataResponse":
"""Create metadata information on an assessment type in a specific subscription.
:param assessment_metadata_name: The Assessment Key - Unique key for the assessment type.
:type assessment_metadata_name: str
:param assessment_metadata: AssessmentMetadata object.
:type assessment_metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadata
:type assessment_metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SecurityAssessmentMetadata, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata
:return: SecurityAssessmentMetadataResponse, or the result of cls(response)
:rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

Expand All @@ -320,7 +320,7 @@ async def create_in_subscription(
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(assessment_metadata, 'SecurityAssessmentMetadata')
body_content = self._serialize.body(assessment_metadata, 'SecurityAssessmentMetadataResponse')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
Expand All @@ -330,7 +330,7 @@ async def create_in_subscription(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response)
deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})
Expand Down Expand Up @@ -358,7 +358,7 @@ async def delete_in_subscription(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-01-01"
api_version = "2021-06-01"
accept = "application/json"

# Construct URL
Expand Down
Loading

0 comments on commit df614df

Please sign in to comment.