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 azure-mgmt-costmanagement] [T2] python track2 config for costmanagement #4093

Closed
Closed
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 @@ -64,7 +64,6 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.views = ViewsOperations(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"chosen_version": "2020-06-01",
"total_api_version_list": ["2020-06-01"],
"client": {
"name": "CostManagementClient",
"filename": "_cost_management_client",
"description": "CostManagementClient.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": true
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
}
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
}
},
"constant": {
},
"call": "credential"
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
},
"operation_groups": {
"views": "ViewsOperations",
"alerts": "AlertsOperations",
"forecast": "ForecastOperations",
"dimensions": "DimensionsOperations",
"query": "QueryOperations",
"operations": "Operations",
"exports": "ExportsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.views = ViewsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
OperatorType,
PivotType,
QueryColumnType,
QueryOperatorType,
RecurrenceType,
ReportConfigColumnType,
ReportConfigSortingDirection,
Expand Down Expand Up @@ -232,6 +233,7 @@
'OperatorType',
'PivotType',
'QueryColumnType',
'QueryOperatorType',
'RecurrenceType',
'ReportConfigColumnType',
'ReportConfigSortingDirection',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ class QueryColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
TAG = "Tag"
DIMENSION = "Dimension"

class QueryOperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The operator to use for comparison.
"""

IN_ENUM = "In"

class RecurrenceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The schedule recurrence.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def __init__(
self.destination = kwargs['destination']


class ExportExecution(Resource):
class ExportExecution(ProxyResource):
"""An export execution.

Variables are only populated by the server, and will be ignored when sending a request.
Expand All @@ -806,8 +806,9 @@ class ExportExecution(Resource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param execution_type: The type of the export execution. Possible values include: "OnDemand",
"Scheduled".
:type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType
Expand Down Expand Up @@ -836,14 +837,13 @@ class ExportExecution(Resource):
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'execution_type': {'key': 'properties.executionType', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'},
Expand Down Expand Up @@ -999,23 +999,17 @@ def __init__(
class ExportSchedule(msrest.serialization.Model):
"""The schedule associated with the export.

All required parameters must be populated in order to send to Azure.

:param status: The status of the export's schedule. If 'Inactive', the export's schedule is
paused. Possible values include: "Active", "Inactive".
:type status: str or ~azure.mgmt.costmanagement.models.StatusType
:param recurrence: Required. The schedule recurrence. Possible values include: "Daily",
"Weekly", "Monthly", "Annually".
:param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
"Monthly", "Annually".
:type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType
:param recurrence_period: Has start and end date of the recurrence. The start date must be in
future. If present, the end date must be greater than start date.
:type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod
"""

_validation = {
'recurrence': {'required': True},
}

_attribute_map = {
'status': {'key': 'status', 'type': 'str'},
'recurrence': {'key': 'recurrence', 'type': 'str'},
Expand All @@ -1028,7 +1022,7 @@ def __init__(
):
super(ExportSchedule, self).__init__(**kwargs)
self.status = kwargs.get('status', None)
self.recurrence = kwargs['recurrence']
self.recurrence = kwargs.get('recurrence', None)
self.recurrence_period = kwargs.get('recurrence_period', None)


Expand Down Expand Up @@ -1351,9 +1345,8 @@ class QueryComparisonExpression(msrest.serialization.Model):

:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In",
"Contains".
:type operator: str or ~azure.mgmt.costmanagement.models.OperatorType
:param operator: Required. The operator to use for comparison. Possible values include: "In".
:type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def __init__(
self.destination = destination


class ExportExecution(Resource):
class ExportExecution(ProxyResource):
"""An export execution.

Variables are only populated by the server, and will be ignored when sending a request.
Expand All @@ -890,8 +890,9 @@ class ExportExecution(Resource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar tags: A set of tags. Resource tags.
:vartype tags: dict[str, str]
:param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be
used to determine whether the user is updating the latest version or not.
:type e_tag: str
:param execution_type: The type of the export execution. Possible values include: "OnDemand",
"Scheduled".
:type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType
Expand Down Expand Up @@ -920,14 +921,13 @@ class ExportExecution(Resource):
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'execution_type': {'key': 'properties.executionType', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'},
Expand All @@ -942,6 +942,7 @@ class ExportExecution(Resource):
def __init__(
self,
*,
e_tag: Optional[str] = None,
execution_type: Optional[Union[str, "ExecutionType"]] = None,
status: Optional[Union[str, "ExecutionStatus"]] = None,
submitted_by: Optional[str] = None,
Expand All @@ -953,7 +954,7 @@ def __init__(
error: Optional["ErrorDetails"] = None,
**kwargs
):
super(ExportExecution, self).__init__(**kwargs)
super(ExportExecution, self).__init__(e_tag=e_tag, **kwargs)
self.execution_type = execution_type
self.status = status
self.submitted_by = submitted_by
Expand Down Expand Up @@ -1102,23 +1103,17 @@ def __init__(
class ExportSchedule(msrest.serialization.Model):
"""The schedule associated with the export.

All required parameters must be populated in order to send to Azure.

:param status: The status of the export's schedule. If 'Inactive', the export's schedule is
paused. Possible values include: "Active", "Inactive".
:type status: str or ~azure.mgmt.costmanagement.models.StatusType
:param recurrence: Required. The schedule recurrence. Possible values include: "Daily",
"Weekly", "Monthly", "Annually".
:param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
"Monthly", "Annually".
:type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType
:param recurrence_period: Has start and end date of the recurrence. The start date must be in
future. If present, the end date must be greater than start date.
:type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod
"""

_validation = {
'recurrence': {'required': True},
}

_attribute_map = {
'status': {'key': 'status', 'type': 'str'},
'recurrence': {'key': 'recurrence', 'type': 'str'},
Expand All @@ -1128,8 +1123,8 @@ class ExportSchedule(msrest.serialization.Model):
def __init__(
self,
*,
recurrence: Union[str, "RecurrenceType"],
status: Optional[Union[str, "StatusType"]] = None,
recurrence: Optional[Union[str, "RecurrenceType"]] = None,
recurrence_period: Optional["ExportRecurrencePeriod"] = None,
**kwargs
):
Expand Down Expand Up @@ -1488,9 +1483,8 @@ class QueryComparisonExpression(msrest.serialization.Model):

:param name: Required. The name of the column to use in comparison.
:type name: str
:param operator: Required. The operator to use for comparison. Possible values include: "In",
"Contains".
:type operator: str or ~azure.mgmt.costmanagement.models.OperatorType
:param operator: Required. The operator to use for comparison. Possible values include: "In".
:type operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
Expand All @@ -1511,7 +1505,7 @@ def __init__(
self,
*,
name: str,
operator: Union[str, "OperatorType"],
operator: Union[str, "QueryOperatorType"],
values: List[str],
**kwargs
):
Expand Down