Skip to content

Commit

Permalink
CodeGen from PR 14311 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ecde128cfe1d34d162308d041e67719d2218fa83 into 4b7dca5
  • Loading branch information
SDKAuto committed May 8, 2021
1 parent 8dd26ca commit e18406e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 11 deletions.
1 change: 1 addition & 0 deletions sdk/iothub/azure-mgmt-iotcentral/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/iothub/azure-mgmt-iotcentral/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "V2",
"use": "@microsoft.azure/autorest.python@~4.0.71",
"commit": "bb595a850fd98dbff142fec6fcc9709efb45d604",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/iotcentral/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk [email protected]/autorest.python@~4.0.71 --version=V2",
"readme": "specification/iotcentral/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
super(IotCentralClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-09-01'
self.api_version = '2021-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from ._paged_models import AppTemplatePaged
from ._paged_models import OperationPaged
from ._iot_central_client_enums import (
AppState,
AppSku,
)

Expand All @@ -55,5 +56,6 @@
'AppPaged',
'AppTemplatePaged',
'OperationPaged',
'AppState',
'AppSku',
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
from enum import Enum


class AppState(str, Enum):

created = "created"
deleted = "deleted"
suspended = "suspended"


class AppSku(str, Enum):

f1 = "F1"
s1 = "S1"
st0 = "ST0"
st1 = "ST1"
st2 = "ST2"
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class App(Resource):
Optional; if not specified, defaults to a blank blueprint and allows the
application to be defined from scratch.
:type template: str
:param state: The current state of the application. Possible values
include: 'created', 'deleted', 'suspended'
:type state: str or ~azure.mgmt.iotcentral.models.AppState
:param sku: Required. A valid instance SKU.
:type sku: ~azure.mgmt.iotcentral.models.AppSkuInfo
"""
Expand All @@ -109,6 +112,7 @@ class App(Resource):
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'subdomain': {'key': 'properties.subdomain', 'type': 'str'},
'template': {'key': 'properties.template', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'AppSkuInfo'},
}

Expand All @@ -118,6 +122,7 @@ def __init__(self, **kwargs):
self.display_name = kwargs.get('display_name', None)
self.subdomain = kwargs.get('subdomain', None)
self.template = kwargs.get('template', None)
self.state = kwargs.get('state', None)
self.sku = kwargs.get('sku', None)


Expand Down Expand Up @@ -177,6 +182,9 @@ class AppPatch(Model):
Optional; if not specified, defaults to a blank blueprint and allows the
application to be defined from scratch.
:type template: str
:param state: The current state of the application. Possible values
include: 'created', 'deleted', 'suspended'
:type state: str or ~azure.mgmt.iotcentral.models.AppState
"""

_validation = {
Expand All @@ -190,6 +198,7 @@ class AppPatch(Model):
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'subdomain': {'key': 'properties.subdomain', 'type': 'str'},
'template': {'key': 'properties.template', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
}

def __init__(self, **kwargs):
Expand All @@ -200,6 +209,7 @@ def __init__(self, **kwargs):
self.display_name = kwargs.get('display_name', None)
self.subdomain = kwargs.get('subdomain', None)
self.template = kwargs.get('template', None)
self.state = kwargs.get('state', None)


class AppSkuInfo(Model):
Expand All @@ -208,7 +218,7 @@ class AppSkuInfo(Model):
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the SKU. Possible values include: 'F1',
'S1', 'ST0', 'ST1', 'ST2'
'ST0', 'ST1', 'ST2'
:type name: str or ~azure.mgmt.iotcentral.models.AppSku
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class App(Resource):
Optional; if not specified, defaults to a blank blueprint and allows the
application to be defined from scratch.
:type template: str
:param state: The current state of the application. Possible values
include: 'created', 'deleted', 'suspended'
:type state: str or ~azure.mgmt.iotcentral.models.AppState
:param sku: Required. A valid instance SKU.
:type sku: ~azure.mgmt.iotcentral.models.AppSkuInfo
"""
Expand All @@ -109,15 +112,17 @@ class App(Resource):
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'subdomain': {'key': 'properties.subdomain', 'type': 'str'},
'template': {'key': 'properties.template', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'AppSkuInfo'},
}

def __init__(self, *, location: str, sku, tags=None, display_name: str=None, subdomain: str=None, template: str=None, **kwargs) -> None:
def __init__(self, *, location: str, sku, tags=None, display_name: str=None, subdomain: str=None, template: str=None, state=None, **kwargs) -> None:
super(App, self).__init__(location=location, tags=tags, **kwargs)
self.application_id = None
self.display_name = display_name
self.subdomain = subdomain
self.template = template
self.state = state
self.sku = sku


Expand Down Expand Up @@ -177,6 +182,9 @@ class AppPatch(Model):
Optional; if not specified, defaults to a blank blueprint and allows the
application to be defined from scratch.
:type template: str
:param state: The current state of the application. Possible values
include: 'created', 'deleted', 'suspended'
:type state: str or ~azure.mgmt.iotcentral.models.AppState
"""

_validation = {
Expand All @@ -190,16 +198,18 @@ class AppPatch(Model):
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'subdomain': {'key': 'properties.subdomain', 'type': 'str'},
'template': {'key': 'properties.template', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
}

def __init__(self, *, tags=None, sku=None, display_name: str=None, subdomain: str=None, template: str=None, **kwargs) -> None:
def __init__(self, *, tags=None, sku=None, display_name: str=None, subdomain: str=None, template: str=None, state=None, **kwargs) -> None:
super(AppPatch, self).__init__(**kwargs)
self.tags = tags
self.sku = sku
self.application_id = None
self.display_name = display_name
self.subdomain = subdomain
self.template = template
self.state = state


class AppSkuInfo(Model):
Expand All @@ -208,7 +218,7 @@ class AppSkuInfo(Model):
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the SKU. Possible values include: 'F1',
'S1', 'ST0', 'ST1', 'ST2'
'ST0', 'ST1', 'ST2'
:type name: str or ~azure.mgmt.iotcentral.models.AppSku
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The version of the API. Constant value: "2018-09-01".
:ivar api_version: The version of the API. Constant value: "2021-06-01".
"""

models = models
Expand All @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-09-01"
self.api_version = "2021-06-01"

self.config = config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Operations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The version of the API. Constant value: "2018-09-01".
:ivar api_version: The version of the API. Constant value: "2021-06-01".
"""

models = models
Expand All @@ -35,13 +35,13 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2018-09-01"
self.api_version = "2021-06-01"

self.config = config

def list(
self, custom_headers=None, raw=False, **operation_config):
"""Lists all of the available IoT Central application REST API operations.
"""Lists all of the available IoT Central Resource Provider operations.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
Expand Down

0 comments on commit e18406e

Please sign in to comment.