Skip to content

Commit

Permalink
T2 costmanagement 2021 02 04 (#16529)
Browse files Browse the repository at this point in the history
* CodeGen from PR 12835 in Azure/azure-rest-api-specs
[T2] python track2 config for costmanagement (#12835)

* add python track2 config for costmanagement

* fix track2 pipeline

* test,version,CHANGELOG

* fix changelog and version

Co-authored-by: SDKAuto <[email protected]>
  • Loading branch information
00Kai0 and SDKAuto authored Feb 7, 2021
1 parent 70f2bab commit 90807b0
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 45 deletions.
10 changes: 10 additions & 0 deletions sdk/costmanagement/azure-mgmt-costmanagement/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release History

## 1.0.0 (2021-02-04)

**Features**

- Model ExportExecution has a new parameter e_tag

**Breaking changes**

- Model ExportExecution no longer has parameter tags

## 1.0.0b1 (2020-12-09)

This is beta preview version.
Expand Down
10 changes: 4 additions & 6 deletions sdk/costmanagement/azure-mgmt-costmanagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ library.
For a more complete set of Azure libraries, see the
[azure sdk python release](https://aka.ms/azsdk/python/all).

## Usage
# Usage


To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)



For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
Code samples for this package can be found at [Cost Management Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples


Code samples for this package can be found at [Costmanagement Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in
Expand Down
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 @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0"
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

0 comments on commit 90807b0

Please sign in to comment.