diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py index e0c4e4983d6b..8839ceccdb50 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py @@ -58,30 +58,37 @@ class ContainerRegistryManagementClient(object): object` :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str + :param str api_version: API version to use if no profile is provided, or if + missing in profile. :param str base_url: Service URL - """ + :param profile: A dict using operation group name to API version. + :type profile: dict[str, str] """ DEFAULT_API_VERSION = '2017-10-01' + DEFAULT_PROFILE = None def __init__( - self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None): + self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None, profile=DEFAULT_PROFILE): self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) self._client = ServiceClient(self.config.credentials, self.config) - client_models = {k: v for k, v in self.models(api_version).__dict__.items() if isinstance(v, type)} self.api_version = api_version - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self.profile = dict(profile) if profile is not None else {} ############ Generated from here ############ + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + @classmethod def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: * 2017-03-01: :mod:`v2017_03_01.models` * 2017-10-01: :mod:`v2017_10_01.models` + * 2017-10-01: :mod:`v2018_02_01_preview.models` """ if api_version == '2017-03-01': from .v2017_03_01 import models @@ -89,7 +96,49 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-10-01': from .v2017_10_01 import models return models + elif api_version == '2017-10-01': + from .v2018_02_01_preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def build_steps(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`BuildStepsOperations` + """ + api_version = self.profile.get('build_steps', self.api_version) + if api_version == '2017-10-01': + from .v2018_02_01_preview.operations import BuildStepsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def build_tasks(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`BuildTasksOperations` + """ + api_version = self.profile.get('build_tasks', self.api_version) + if api_version == '2017-10-01': + from .v2018_02_01_preview.operations import BuildTasksOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def builds(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`BuildsOperations` + """ + api_version = self.profile.get('builds', self.api_version) + if api_version == '2017-10-01': + from .v2018_02_01_preview.operations import BuildsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def operations(self): @@ -97,14 +146,18 @@ def operations(self): * 2017-03-01: :class:`Operations` * 2017-10-01: :class:`Operations` + * 2017-10-01: :class:`Operations` """ - if self.api_version == '2017-03-01': + api_version = self.profile.get('operations', self.api_version) + if api_version == '2017-03-01': from .v2017_03_01.operations import Operations as OperationClass - elif self.api_version == '2017-10-01': + elif api_version == '2017-10-01': from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2017-10-01': + from .v2018_02_01_preview.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(self.api_version)) - return OperationClass(self._client, self.config, self._serialize, self._deserialize) + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def registries(self): @@ -112,35 +165,47 @@ def registries(self): * 2017-03-01: :class:`RegistriesOperations` * 2017-10-01: :class:`RegistriesOperations` + * 2017-10-01: :class:`RegistriesOperations` """ - if self.api_version == '2017-03-01': + api_version = self.profile.get('registries', self.api_version) + if api_version == '2017-03-01': from .v2017_03_01.operations import RegistriesOperations as OperationClass - elif self.api_version == '2017-10-01': + elif api_version == '2017-10-01': from .v2017_10_01.operations import RegistriesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(self.api_version)) - return OperationClass(self._client, self.config, self._serialize, self._deserialize) + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def replications(self): """Instance depends on the API version: * 2017-10-01: :class:`ReplicationsOperations` + * 2017-10-01: :class:`ReplicationsOperations` """ - if self.api_version == '2017-10-01': + api_version = self.profile.get('replications', self.api_version) + if api_version == '2017-10-01': from .v2017_10_01.operations import ReplicationsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(self.api_version)) - return OperationClass(self._client, self.config, self._serialize, self._deserialize) + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def webhooks(self): """Instance depends on the API version: * 2017-10-01: :class:`WebhooksOperations` + * 2017-10-01: :class:`WebhooksOperations` """ - if self.api_version == '2017-10-01': + api_version = self.profile.get('webhooks', self.api_version) + if api_version == '2017-10-01': from .v2017_10_01.operations import WebhooksOperations as OperationClass + elif api_version == '2017-10-01': + from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(self.api_version)) - return OperationClass(self._client, self.config, self._serialize, self._deserialize) + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/build.json b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/build.json deleted file mode 100644 index 6b3f5d1afe0a..000000000000 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/build.json +++ /dev/null @@ -1,423 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4210", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "dts-generator": "^2.1.0", - "mocha": "^4.0.1", - "mocha-typescript": "^1.1.7", - "shx": "0.2.2", - "static-link": "^0.2.3", - "vscode-jsonrpc": "^3.3.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_shasum": "bcf1afb414f3a31bc3c8be1753da1e704cd1242a", - "_shrinkwrap": null, - "bin": { - "autorest-core": "./dist/app.js", - "autorest-language-service": "dist/language-service/language-service.js" - }, - "_id": "@microsoft.azure/autorest-core@2.0.4210", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.3457.05142695059.personal-lock", - "options": { - "port": 63873, - "host": "2130744252", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.3457.05142695059.personal-lock:63873" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4215", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.53", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "dts-generator": "^2.1.0", - "mocha": "^4.0.1", - "mocha-typescript": "^1.1.7", - "shx": "0.2.2", - "static-link": "^0.2.3", - "vscode-jsonrpc": "^3.3.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_shasum": "e8275e3cfb9bde9e6aaeb70396119c4bd83e770c", - "_shrinkwrap": null, - "bin": { - "autorest-core": "./dist/app.js", - "autorest-language-service": "dist/language-service/language-service.js" - }, - "_id": "@microsoft.azure/autorest-core@2.0.4215", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.3457.05142695059.personal-lock", - "options": { - "port": 63873, - "host": "2130744252", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.3457.05142695059.personal-lock:63873" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.0.21", - "dependencies": { - "dotnet-2.0.0": "^1.3.2" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.0.21", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.3457.05142695059.personal-lock", - "options": { - "port": 63873, - "host": "2130744252", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.3457.05142695059.personal-lock:63873" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.3.38", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.1", - "autorest": "^2.0.4201", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "903bb77932e4ed1b8bc3b25cc39b167143494f6c", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.3.38", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.3457.05142695059.personal-lock", - "options": { - "port": 63873, - "host": "2130744252", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.3457.05142695059.personal-lock:63873" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.1.26", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.12", - "autorest": "^2.0.4203", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_shasum": "fce552a203c4b359b3f21a194a6deacc8f40ae80", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.1.26", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.3457.05142695059.personal-lock", - "options": { - "port": 63873, - "host": "2130744252", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.3457.05142695059.personal-lock:63873" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": {} -} \ No newline at end of file diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py index dd6422fd6d3d..000827e1428c 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -43,14 +43,14 @@ def __init__( super(ContainerRegistryManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('containerregistrymanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-containerregistry/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials self.subscription_id = subscription_id -class ContainerRegistryManagementClient(object): +class ContainerRegistryManagementClient(SDKClient): """ContainerRegistryManagementClient :ivar config: Configuration for client. @@ -73,7 +73,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ContainerRegistryManagementClient, 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 = '2017-03-01' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py index 5e25c31fa0c9..1558231f6b05 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py @@ -9,20 +9,36 @@ # regenerated. # -------------------------------------------------------------------------- -from .registry_name_check_request import RegistryNameCheckRequest -from .registry_name_status import RegistryNameStatus -from .operation_display_definition import OperationDisplayDefinition -from .operation_definition import OperationDefinition -from .sku import Sku -from .storage_account_properties import StorageAccountProperties -from .registry import Registry -from .storage_account_parameters import StorageAccountParameters -from .registry_create_parameters import RegistryCreateParameters -from .registry_update_parameters import RegistryUpdateParameters -from .registry_password import RegistryPassword -from .registry_list_credentials_result import RegistryListCredentialsResult -from .regenerate_credential_parameters import RegenerateCredentialParameters -from .resource import Resource +try: + from .registry_name_check_request_py3 import RegistryNameCheckRequest + from .registry_name_status_py3 import RegistryNameStatus + from .operation_display_definition_py3 import OperationDisplayDefinition + from .operation_definition_py3 import OperationDefinition + from .sku_py3 import Sku + from .storage_account_properties_py3 import StorageAccountProperties + from .registry_py3 import Registry + from .storage_account_parameters_py3 import StorageAccountParameters + from .registry_create_parameters_py3 import RegistryCreateParameters + from .registry_update_parameters_py3 import RegistryUpdateParameters + from .registry_password_py3 import RegistryPassword + from .registry_list_credentials_result_py3 import RegistryListCredentialsResult + from .regenerate_credential_parameters_py3 import RegenerateCredentialParameters + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .registry_name_check_request import RegistryNameCheckRequest + from .registry_name_status import RegistryNameStatus + from .operation_display_definition import OperationDisplayDefinition + from .operation_definition import OperationDefinition + from .sku import Sku + from .storage_account_properties import StorageAccountProperties + from .registry import Registry + from .storage_account_parameters import StorageAccountParameters + from .registry_create_parameters import RegistryCreateParameters + from .registry_update_parameters import RegistryUpdateParameters + from .registry_password import RegistryPassword + from .registry_list_credentials_result import RegistryListCredentialsResult + from .regenerate_credential_parameters import RegenerateCredentialParameters + from .resource import Resource from .registry_paged import RegistryPaged from .operation_definition_paged import OperationDefinitionPaged from .container_registry_management_client_enums import ( diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py index 770162ccc136..97bbbc73985b 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py @@ -12,18 +12,18 @@ from enum import Enum -class SkuTier(Enum): +class SkuTier(str, Enum): basic = "Basic" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" succeeded = "Succeeded" -class PasswordName(Enum): +class PasswordName(str, Enum): password = "password" password2 = "password2" diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py index 10401c2f267e..bf626f313f10 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py @@ -28,6 +28,7 @@ class OperationDefinition(Model): 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, } - def __init__(self, name=None, display=None): - self.name = name - self.display = display + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py new file mode 100644 index 000000000000..f95ac74f01e7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the container registry + operation. + :type display: + ~azure.mgmt.containerregistry.v2017_03_01.models.OperationDisplayDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py index a26f7630f236..6cb8463b21fc 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py @@ -32,8 +32,9 @@ class OperationDisplayDefinition(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py new file mode 100644 index 000000000000..98abb699335c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayDefinition(Model): + """The display information for a container registry operation. + + :param provider: The resource provider name: Microsoft.ContainerRegistry. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py index ce1f2492a001..369d12cf09e7 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py @@ -15,8 +15,11 @@ class RegenerateCredentialParameters(Model): """The parameters used to regenerate the login credential. - :param name: Specifies name of the password which should be regenerated -- - password or password2. Possible values include: 'password', 'password2' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' :type name: str or ~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName """ @@ -29,5 +32,6 @@ class RegenerateCredentialParameters(Model): 'name': {'key': 'name', 'type': 'PasswordName'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py new file mode 100644 index 000000000000..4b290d4e53e3 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateCredentialParameters(Model): + """The parameters used to regenerate the login credential. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py index db64130db809..144dc80248be 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py @@ -18,18 +18,20 @@ class Registry(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] - :param sku: The SKU of the container registry. + :param sku: Required. The SKU of the container registry. :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku :ivar login_server: The URL that can be used to log into the container registry. @@ -76,11 +78,11 @@ class Registry(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, } - def __init__(self, location, sku, tags=None, admin_user_enabled=False, storage_account=None): - super(Registry, self).__init__(location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(Registry, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.login_server = None self.creation_date = None self.provisioning_state = None - self.admin_user_enabled = admin_user_enabled - self.storage_account = storage_account + self.admin_user_enabled = kwargs.get('admin_user_enabled', False) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py index fc25de8c8f41..23fe20120594 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py @@ -15,19 +15,21 @@ class RegistryCreateParameters(Model): """The parameters for creating a container registry. + All required parameters must be populated in order to send to Azure. + :param tags: The tags for the container registry. :type tags: dict[str, str] - :param location: The location of the container registry. This cannot be - changed after the resource is created. + :param location: Required. The location of the container registry. This + cannot be changed after the resource is created. :type location: str - :param sku: The SKU of the container registry. + :param sku: Required. The SKU of the container registry. :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku :param admin_user_enabled: The value that indicates whether the admin user is enabled. Default value: False . :type admin_user_enabled: bool - :param storage_account: The parameters of a storage account for the - container registry. If specified, the storage account must be in the same - physical location as the container registry. + :param storage_account: Required. The parameters of a storage account for + the container registry. If specified, the storage account must be in the + same physical location as the container registry. :type storage_account: ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters """ @@ -46,9 +48,10 @@ class RegistryCreateParameters(Model): 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'}, } - def __init__(self, location, sku, storage_account, tags=None, admin_user_enabled=False): - self.tags = tags - self.location = location - self.sku = sku - self.admin_user_enabled = admin_user_enabled - self.storage_account = storage_account + def __init__(self, **kwargs): + super(RegistryCreateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.sku = kwargs.get('sku', None) + self.admin_user_enabled = kwargs.get('admin_user_enabled', False) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py new file mode 100644 index 000000000000..6eeecd4cc8fa --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryCreateParameters(Model): + """The parameters for creating a container registry. + + All required parameters must be populated in order to send to Azure. + + :param tags: The tags for the container registry. + :type tags: dict[str, str] + :param location: Required. The location of the container registry. This + cannot be changed after the resource is created. + :type location: str + :param sku: Required. The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. Default value: False . + :type admin_user_enabled: bool + :param storage_account: Required. The parameters of a storage account for + the container registry. If specified, the storage account must be in the + same physical location as the container registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'storage_account': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'}, + } + + def __init__(self, *, location: str, sku, storage_account, tags=None, admin_user_enabled: bool=False, **kwargs) -> None: + super(RegistryCreateParameters, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.sku = sku + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py index 6fbcc9ce49b3..78e594f3a99b 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py @@ -27,6 +27,7 @@ class RegistryListCredentialsResult(Model): 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, } - def __init__(self, username=None, passwords=None): - self.username = username - self.passwords = passwords + def __init__(self, **kwargs): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py new file mode 100644 index 000000000000..f66ca4006ed7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryListCredentialsResult(Model): + """The response from the ListCredentials operation. + + :param username: The username for a container registry. + :type username: str + :param passwords: The list of passwords for a container registry. + :type passwords: + list[~azure.mgmt.containerregistry.v2017_03_01.models.RegistryPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, + } + + def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None: + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = username + self.passwords = passwords diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py index d83e4b3e1cd8..9d4a575eac04 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py @@ -18,11 +18,13 @@ class RegistryNameCheckRequest(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The name of the container registry. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. :type name: str - :ivar type: The resource type of the container registry. This field must - be set to 'Microsoft.ContainerRegistry/registries'. Default value: - "Microsoft.ContainerRegistry/registries" . + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . :vartype type: str """ @@ -38,5 +40,6 @@ class RegistryNameCheckRequest(Model): type = "Microsoft.ContainerRegistry/registries" - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py new file mode 100644 index 000000000000..67f5ff9be671 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameCheckRequest(Model): + """A request to check whether a container registry name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. + :type name: str + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.ContainerRegistry/registries" + + def __init__(self, *, name: str, **kwargs) -> None: + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py index 526515a435f6..94345ba6d549 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py @@ -32,7 +32,8 @@ class RegistryNameStatus(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py new file mode 100644 index 000000000000..8b7b264c2d0d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameStatus(Model): + """The result of a request to check the availability of a container registry + name. + + :param name_available: The value that indicates whether the name is + available. + :type name_available: bool + :param reason: If any, the reason that the name is not available. + :type reason: str + :param message: If any, the error message that provides more detail for + the reason that the name is not available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py index d024ea7c9ccd..695e0c9078a9 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py @@ -28,6 +28,7 @@ class RegistryPassword(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name=None, value=None): - self.name = name - self.value = value + def __init__(self, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py new file mode 100644 index 000000000000..ef46326e9bc0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryPassword(Model): + """The login password for the container registry. + + :param name: The password name. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName + :param value: The password value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name=None, value: str=None, **kwargs) -> None: + super(RegistryPassword, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py new file mode 100644 index 000000000000..d7bff8b5bbae --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Registry(Resource): + """An object that represents a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param sku: Required. The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku + :ivar login_server: The URL that can be used to log into the container + registry. + :vartype login_server: str + :ivar creation_date: The creation date of the container registry in + ISO8601 format. + :vartype creation_date: datetime + :ivar provisioning_state: The provisioning state of the container registry + at the time the operation was called. Possible values include: 'Creating', + 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2017_03_01.models.ProvisioningState + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. Default value: False . + :type admin_user_enabled: bool + :param storage_account: The properties of the storage account for the + container registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'login_server': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'login_server': {'key': 'properties.loginServer', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None: + super(Registry, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.login_server = None + self.creation_date = None + self.provisioning_state = None + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py index 884b6131fe96..df0974b20539 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py @@ -33,7 +33,8 @@ class RegistryUpdateParameters(Model): 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'}, } - def __init__(self, tags=None, admin_user_enabled=None, storage_account=None): - self.tags = tags - self.admin_user_enabled = admin_user_enabled - self.storage_account = storage_account + def __init__(self, **kwargs): + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.admin_user_enabled = kwargs.get('admin_user_enabled', None) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py new file mode 100644 index 000000000000..86c8fa769696 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUpdateParameters(Model): + """The parameters for updating a container registry. + + :param tags: The tags for the container registry. + :type tags: dict[str, str] + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param storage_account: The parameters of a storage account for the + container registry. If specified, the storage account must be in the same + physical location as the container registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'}, + } + + def __init__(self, *, tags=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None: + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py index b218c46aa3d1..3965a6f0cf40 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] @@ -46,9 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py new file mode 100644 index 000000000000..3a1d4bc4edd1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py index cd355ae33508..71d20c90052f 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py @@ -18,8 +18,10 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The SKU name of the container registry. Required for registry - creation. Allowed value: Basic. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Allowed value: Basic. :type name: str :ivar tier: The SKU tier based on the SKU name. Possible values include: 'Basic' @@ -37,6 +39,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py new file mode 100644 index 000000000000..f4c58ea254e3 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Allowed value: Basic. + :type name: str + :ivar tier: The SKU tier based on the SKU name. Possible values include: + 'Basic' + :vartype tier: str or + ~azure.mgmt.containerregistry.v2017_03_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py index 9d617be30da4..fcad011732ae 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py @@ -15,9 +15,11 @@ class StorageAccountParameters(Model): """The parameters of a storage account for a container registry. - :param name: The name of the storage account. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the storage account. :type name: str - :param access_key: The access key to the storage account. + :param access_key: Required. The access key to the storage account. :type access_key: str """ @@ -31,6 +33,7 @@ class StorageAccountParameters(Model): 'access_key': {'key': 'accessKey', 'type': 'str'}, } - def __init__(self, name, access_key): - self.name = name - self.access_key = access_key + def __init__(self, **kwargs): + super(StorageAccountParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.access_key = kwargs.get('access_key', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py new file mode 100644 index 000000000000..cc1656726e04 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountParameters(Model): + """The parameters of a storage account for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the storage account. + :type name: str + :param access_key: Required. The access key to the storage account. + :type access_key: str + """ + + _validation = { + 'name': {'required': True}, + 'access_key': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + } + + def __init__(self, *, name: str, access_key: str, **kwargs) -> None: + super(StorageAccountParameters, self).__init__(**kwargs) + self.name = name + self.access_key = access_key diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py index badd5473b7f3..dc929f094999 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py @@ -23,5 +23,6 @@ class StorageAccountProperties(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - self.name = name + def __init__(self, **kwargs): + super(StorageAccountProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py new file mode 100644 index 000000000000..c23352eedb94 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountProperties(Model): + """The properties of a storage account for a container registry. + + :param name: The name of the storage account. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(StorageAccountProperties, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py index cf9e87f5602c..d7fb26f84728 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-03-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.ContainerRegistry/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -79,7 +79,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -97,3 +97,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py index 4a414b2679b2..f5d1d26d17fd 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py @@ -12,7 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +24,7 @@ class RegistriesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-03-01". """ @@ -60,7 +61,7 @@ def check_name_availability( registry_name_check_request = models.RegistryNameCheckRequest(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -86,7 +87,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -103,6 +104,7 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability'} def get( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -124,7 +126,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -148,7 +150,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -165,32 +167,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} - def create( - self, resource_group_name, registry_name, registry_create_parameters, custom_headers=None, raw=False, **operation_config): - """Creates a container registry with the specified parameters. - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param registry_name: The name of the container registry. - :type registry_name: str - :param registry_create_parameters: The parameters for creating a - container registry. - :type registry_create_parameters: - ~azure.mgmt.containerregistry.v2017_03_01.models.RegistryCreateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Registry or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, registry_name, registry_create_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -216,31 +199,63 @@ def create( body_content = self._serialize.body(registry_create_parameters, 'RegistryCreateParameters') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized - deserialized = None + def create( + self, resource_group_name, registry_name, registry_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param registry_create_parameters: The parameters for creating a + container registry. + :type registry_create_parameters: + ~azure.mgmt.containerregistry.v2017_03_01.models.RegistryCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Registry or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_03_01.models.Registry]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry_create_parameters=registry_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if response.status_code == 200: - deserialized = self._deserialize('Registry', response) + def get_long_running_output(response): + deserialized = self._deserialize('Registry', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -248,16 +263,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} def delete( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -278,7 +291,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -302,7 +315,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -312,6 +325,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} def update( self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, **operation_config): @@ -337,7 +351,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -365,7 +379,7 @@ def update( # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -382,6 +396,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -404,7 +419,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -432,7 +447,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -450,6 +465,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -469,7 +485,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -496,7 +512,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -514,6 +530,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries'} def list_credentials( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -537,7 +554,7 @@ def list_credentials( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials' + url = self.list_credentials.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -561,7 +578,7 @@ def list_credentials( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -578,6 +595,7 @@ def list_credentials( return client_raw_response return deserialized + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials'} def regenerate_credential( self, resource_group_name, registry_name, name, custom_headers=None, raw=False, **operation_config): @@ -609,7 +627,7 @@ def regenerate_credential( regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential' + url = self.regenerate_credential.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -637,7 +655,7 @@ def regenerate_credential( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -654,3 +672,4 @@ def regenerate_credential( return client_raw_response return deserialized + regenerate_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/build.json b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/build.json deleted file mode 100644 index 0b4ef0e44480..000000000000 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/build.json +++ /dev/null @@ -1,423 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4210", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "dts-generator": "^2.1.0", - "mocha": "^4.0.1", - "mocha-typescript": "^1.1.7", - "shx": "0.2.2", - "static-link": "^0.2.3", - "vscode-jsonrpc": "^3.3.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_shasum": "bcf1afb414f3a31bc3c8be1753da1e704cd1242a", - "_shrinkwrap": null, - "bin": { - "autorest-core": "./dist/app.js", - "autorest-language-service": "dist/language-service/language-service.js" - }, - "_id": "@microsoft.azure/autorest-core@2.0.4210", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4210/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.1570.730300005676.personal-lock", - "options": { - "port": 32588, - "host": "2130754129", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.1570.730300005676.personal-lock:32588" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4215", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@types/commonmark": "^0.27.0", - "@types/js-yaml": "^3.10.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.53", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "dts-generator": "^2.1.0", - "mocha": "^4.0.1", - "mocha-typescript": "^1.1.7", - "shx": "0.2.2", - "static-link": "^0.2.3", - "vscode-jsonrpc": "^3.3.1" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_shasum": "e8275e3cfb9bde9e6aaeb70396119c4bd83e770c", - "_shrinkwrap": null, - "bin": { - "autorest-core": "./dist/app.js", - "autorest-language-service": "dist/language-service/language-service.js" - }, - "_id": "@microsoft.azure/autorest-core@2.0.4215", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4215/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.1570.730300005676.personal-lock", - "options": { - "port": 32588, - "host": "2130754129", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.1570.730300005676.personal-lock:32588" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.0.21", - "dependencies": { - "dotnet-2.0.0": "^1.3.2" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.0.21", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.1570.730300005676.personal-lock", - "options": { - "port": 32588, - "host": "2130754129", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.1570.730300005676.personal-lock:32588" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.3.38", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.1", - "autorest": "^2.0.4201", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "903bb77932e4ed1b8bc3b25cc39b167143494f6c", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.3.38", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.3.38/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.1570.730300005676.personal-lock", - "options": { - "port": 32588, - "host": "2130754129", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.1570.730300005676.personal-lock:32588" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.1.26", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "2.3.12", - "autorest": "^2.0.4203", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_shasum": "fce552a203c4b359b3f21a194a6deacc8f40ae80", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.1.26", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.1.26/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "sharedLock": { - "name": "/root/.autorest", - "exclusiveLock": { - "name": "_root_.autorest.exclusive-lock", - "options": { - "port": 45234, - "host": "2130706813", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.exclusive-lock:45234" - }, - "busyLock": { - "name": "_root_.autorest.busy-lock", - "options": { - "port": 37199, - "host": "2130756895", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.busy-lock:37199" - }, - "personalLock": { - "name": "_root_.autorest.1570.730300005676.personal-lock", - "options": { - "port": 32588, - "host": "2130754129", - "exclusive": true - }, - "pipe": "/tmp/pipe__root_.autorest.1570.730300005676.personal-lock:32588" - }, - "file": "/tmp/_root_.autorest.lock" - }, - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": {} -} \ No newline at end of file diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py index 94196d76ff89..8ed2eae442ff 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -45,14 +45,14 @@ def __init__( super(ContainerRegistryManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('containerregistrymanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-containerregistry/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials self.subscription_id = subscription_id -class ContainerRegistryManagementClient(object): +class ContainerRegistryManagementClient(SDKClient): """ContainerRegistryManagementClient :ivar config: Configuration for client. @@ -79,7 +79,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ContainerRegistryManagementClient, 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 = '2017-10-01' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py index 4375e516b858..f5ae48dc4c9a 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py @@ -9,36 +9,68 @@ # regenerated. # -------------------------------------------------------------------------- -from .registry_name_check_request import RegistryNameCheckRequest -from .registry_name_status import RegistryNameStatus -from .operation_display_definition import OperationDisplayDefinition -from .operation_definition import OperationDefinition -from .sku import Sku -from .status import Status -from .storage_account_properties import StorageAccountProperties -from .registry import Registry -from .registry_update_parameters import RegistryUpdateParameters -from .registry_password import RegistryPassword -from .registry_list_credentials_result import RegistryListCredentialsResult -from .regenerate_credential_parameters import RegenerateCredentialParameters -from .registry_usage import RegistryUsage -from .registry_usage_list_result import RegistryUsageListResult -from .replication import Replication -from .replication_update_parameters import ReplicationUpdateParameters -from .webhook import Webhook -from .webhook_create_parameters import WebhookCreateParameters -from .webhook_update_parameters import WebhookUpdateParameters -from .event_info import EventInfo -from .callback_config import CallbackConfig -from .target import Target -from .request import Request -from .actor import Actor -from .source import Source -from .event_content import EventContent -from .event_request_message import EventRequestMessage -from .event_response_message import EventResponseMessage -from .event import Event -from .resource import Resource +try: + from .registry_name_check_request_py3 import RegistryNameCheckRequest + from .registry_name_status_py3 import RegistryNameStatus + from .operation_display_definition_py3 import OperationDisplayDefinition + from .operation_definition_py3 import OperationDefinition + from .sku_py3 import Sku + from .status_py3 import Status + from .storage_account_properties_py3 import StorageAccountProperties + from .registry_py3 import Registry + from .registry_update_parameters_py3 import RegistryUpdateParameters + from .registry_password_py3 import RegistryPassword + from .registry_list_credentials_result_py3 import RegistryListCredentialsResult + from .regenerate_credential_parameters_py3 import RegenerateCredentialParameters + from .registry_usage_py3 import RegistryUsage + from .registry_usage_list_result_py3 import RegistryUsageListResult + from .replication_py3 import Replication + from .replication_update_parameters_py3 import ReplicationUpdateParameters + from .webhook_py3 import Webhook + from .webhook_create_parameters_py3 import WebhookCreateParameters + from .webhook_update_parameters_py3 import WebhookUpdateParameters + from .event_info_py3 import EventInfo + from .callback_config_py3 import CallbackConfig + from .target_py3 import Target + from .request_py3 import Request + from .actor_py3 import Actor + from .source_py3 import Source + from .event_content_py3 import EventContent + from .event_request_message_py3 import EventRequestMessage + from .event_response_message_py3 import EventResponseMessage + from .event_py3 import Event + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .registry_name_check_request import RegistryNameCheckRequest + from .registry_name_status import RegistryNameStatus + from .operation_display_definition import OperationDisplayDefinition + from .operation_definition import OperationDefinition + from .sku import Sku + from .status import Status + from .storage_account_properties import StorageAccountProperties + from .registry import Registry + from .registry_update_parameters import RegistryUpdateParameters + from .registry_password import RegistryPassword + from .registry_list_credentials_result import RegistryListCredentialsResult + from .regenerate_credential_parameters import RegenerateCredentialParameters + from .registry_usage import RegistryUsage + from .registry_usage_list_result import RegistryUsageListResult + from .replication import Replication + from .replication_update_parameters import ReplicationUpdateParameters + from .webhook import Webhook + from .webhook_create_parameters import WebhookCreateParameters + from .webhook_update_parameters import WebhookUpdateParameters + from .event_info import EventInfo + from .callback_config import CallbackConfig + from .target import Target + from .request import Request + from .actor import Actor + from .source import Source + from .event_content import EventContent + from .event_request_message import EventRequestMessage + from .event_response_message import EventResponseMessage + from .event import Event + from .resource import Resource from .registry_paged import RegistryPaged from .operation_definition_paged import OperationDefinitionPaged from .replication_paged import ReplicationPaged diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py index 65fc2c851d20..a662f9008a31 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py @@ -25,5 +25,6 @@ class Actor(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - self.name = name + def __init__(self, **kwargs): + super(Actor, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py new file mode 100644 index 000000000000..fdd8b96dda52 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Actor(Model): + """The agent that initiated the event. For most situations, this could be from + the authorization context of the request. + + :param name: The subject or username associated with the request context + that generated the event. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(Actor, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py index bc319783398e..8ad43a9f785a 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py @@ -15,7 +15,10 @@ class CallbackConfig(Model): """The configuration of service URI and custom headers for the webhook. - :param service_uri: The service URI for the webhook to post notifications. + All required parameters must be populated in order to send to Azure. + + :param service_uri: Required. The service URI for the webhook to post + notifications. :type service_uri: str :param custom_headers: Custom headers that will be added to the webhook notifications. @@ -31,6 +34,7 @@ class CallbackConfig(Model): 'custom_headers': {'key': 'customHeaders', 'type': '{str}'}, } - def __init__(self, service_uri, custom_headers=None): - self.service_uri = service_uri - self.custom_headers = custom_headers + def __init__(self, **kwargs): + super(CallbackConfig, self).__init__(**kwargs) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py new file mode 100644 index 000000000000..27ffc7825431 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CallbackConfig(Model): + """The configuration of service URI and custom headers for the webhook. + + All required parameters must be populated in order to send to Azure. + + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + """ + + _validation = { + 'service_uri': {'required': True}, + } + + _attribute_map = { + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'customHeaders', 'type': '{str}'}, + } + + def __init__(self, *, service_uri: str, custom_headers=None, **kwargs) -> None: + super(CallbackConfig, self).__init__(**kwargs) + self.service_uri = service_uri + self.custom_headers = custom_headers diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py index 27993bcfc01a..e3b18196455a 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): classic = "Classic" basic = "Basic" @@ -20,7 +20,7 @@ class SkuName(Enum): premium = "Premium" -class SkuTier(Enum): +class SkuTier(str, Enum): classic = "Classic" basic = "Basic" @@ -28,7 +28,7 @@ class SkuTier(Enum): premium = "Premium" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" updating = "Updating" @@ -38,25 +38,25 @@ class ProvisioningState(Enum): canceled = "Canceled" -class PasswordName(Enum): +class PasswordName(str, Enum): password = "password" password2 = "password2" -class RegistryUsageUnit(Enum): +class RegistryUsageUnit(str, Enum): count = "Count" bytes = "Bytes" -class WebhookStatus(Enum): +class WebhookStatus(str, Enum): enabled = "enabled" disabled = "disabled" -class WebhookAction(Enum): +class WebhookAction(str, Enum): push = "push" delete = "delete" diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py index 68ac650f3375..d112cef92241 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py @@ -33,7 +33,7 @@ class Event(EventInfo): 'event_response_message': {'key': 'eventResponseMessage', 'type': 'EventResponseMessage'}, } - def __init__(self, id=None, event_request_message=None, event_response_message=None): - super(Event, self).__init__(id=id) - self.event_request_message = event_request_message - self.event_response_message = event_response_message + def __init__(self, **kwargs): + super(Event, self).__init__(**kwargs) + self.event_request_message = kwargs.get('event_request_message', None) + self.event_response_message = kwargs.get('event_response_message', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py index 25bf9e74d3d7..d6ee2394c8b8 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py @@ -43,11 +43,12 @@ class EventContent(Model): 'source': {'key': 'source', 'type': 'Source'}, } - def __init__(self, id=None, timestamp=None, action=None, target=None, request=None, actor=None, source=None): - self.id = id - self.timestamp = timestamp - self.action = action - self.target = target - self.request = request - self.actor = actor - self.source = source + def __init__(self, **kwargs): + super(EventContent, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.timestamp = kwargs.get('timestamp', None) + self.action = kwargs.get('action', None) + self.target = kwargs.get('target', None) + self.request = kwargs.get('request', None) + self.actor = kwargs.get('actor', None) + self.source = kwargs.get('source', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py new file mode 100644 index 000000000000..2d7323c2b636 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventContent(Model): + """The content of the event request message. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: ~azure.mgmt.containerregistry.v2017_10_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2017_10_01.models.Request + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: ~azure.mgmt.containerregistry.v2017_10_01.models.Actor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: ~azure.mgmt.containerregistry.v2017_10_01.models.Source + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'Target'}, + 'request': {'key': 'request', 'type': 'Request'}, + 'actor': {'key': 'actor', 'type': 'Actor'}, + 'source': {'key': 'source', 'type': 'Source'}, + } + + def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: + super(EventContent, self).__init__(**kwargs) + self.id = id + self.timestamp = timestamp + self.action = action + self.target = target + self.request = request + self.actor = actor + self.source = source diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py index e88f40e2ff6a..7199044b2e39 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py @@ -23,5 +23,6 @@ class EventInfo(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - self.id = id + def __init__(self, **kwargs): + super(EventInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py new file mode 100644 index 000000000000..192990067407 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventInfo(Model): + """The basic information of an event. + + :param id: The event ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EventInfo, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py new file mode 100644 index 000000000000..d4a92a7e607a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_info import EventInfo + + +class Event(EventInfo): + """The event for a webhook. + + :param id: The event ID. + :type id: str + :param event_request_message: The event request message sent to the + service URI. + :type event_request_message: + ~azure.mgmt.containerregistry.v2017_10_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2017_10_01.models.EventResponseMessage + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'event_request_message': {'key': 'eventRequestMessage', 'type': 'EventRequestMessage'}, + 'event_response_message': {'key': 'eventResponseMessage', 'type': 'EventResponseMessage'}, + } + + def __init__(self, *, id: str=None, event_request_message=None, event_response_message=None, **kwargs) -> None: + super(Event, self).__init__(id=id, **kwargs) + self.event_request_message = event_request_message + self.event_response_message = event_response_message diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py index 058603a1a1a9..3a16ad64c8e3 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py @@ -36,9 +36,10 @@ class EventRequestMessage(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, content=None, headers=None, method=None, request_uri=None, version=None): - self.content = content - self.headers = headers - self.method = method - self.request_uri = request_uri - self.version = version + def __init__(self, **kwargs): + super(EventRequestMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.headers = kwargs.get('headers', None) + self.method = kwargs.get('method', None) + self.request_uri = kwargs.get('request_uri', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py new file mode 100644 index 000000000000..70d3b783c69c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventRequestMessage(Model): + """The event request message sent to the service URI. + + :param content: The content of the event request message. + :type content: + ~azure.mgmt.containerregistry.v2017_10_01.models.EventContent + :param headers: The headers of the event request message. + :type headers: dict[str, str] + :param method: The HTTP method used to send the event request message. + :type method: str + :param request_uri: The URI used to send the event request message. + :type request_uri: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'EventContent'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'method': {'key': 'method', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, content=None, headers=None, method: str=None, request_uri: str=None, version: str=None, **kwargs) -> None: + super(EventRequestMessage, self).__init__(**kwargs) + self.content = content + self.headers = headers + self.method = method + self.request_uri = request_uri + self.version = version diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py index 75b90396b355..ffb8feb12a1e 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py @@ -35,9 +35,10 @@ class EventResponseMessage(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, content=None, headers=None, reason_phrase=None, status_code=None, version=None): - self.content = content - self.headers = headers - self.reason_phrase = reason_phrase - self.status_code = status_code - self.version = version + def __init__(self, **kwargs): + super(EventResponseMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.headers = kwargs.get('headers', None) + self.reason_phrase = kwargs.get('reason_phrase', None) + self.status_code = kwargs.get('status_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py new file mode 100644 index 000000000000..4b1351377b4b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventResponseMessage(Model): + """The event response message received from the service URI. + + :param content: The content of the event response message. + :type content: str + :param headers: The headers of the event response message. + :type headers: dict[str, str] + :param reason_phrase: The reason phrase of the event response message. + :type reason_phrase: str + :param status_code: The status code of the event response message. + :type status_code: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, content: str=None, headers=None, reason_phrase: str=None, status_code: str=None, version: str=None, **kwargs) -> None: + super(EventResponseMessage, self).__init__(**kwargs) + self.content = content + self.headers = headers + self.reason_phrase = reason_phrase + self.status_code = status_code + self.version = version diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py index 320dccdd93b0..3e39fc31b640 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py @@ -28,6 +28,7 @@ class OperationDefinition(Model): 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, } - def __init__(self, name=None, display=None): - self.name = name - self.display = display + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py new file mode 100644 index 000000000000..21bf5937c2e7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the container registry + operation. + :type display: + ~azure.mgmt.containerregistry.v2017_10_01.models.OperationDisplayDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py index a26f7630f236..6cb8463b21fc 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py @@ -32,8 +32,9 @@ class OperationDisplayDefinition(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py new file mode 100644 index 000000000000..98abb699335c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayDefinition(Model): + """The display information for a container registry operation. + + :param provider: The resource provider name: Microsoft.ContainerRegistry. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py index 7e7482408dd9..bf56b8462b6d 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py @@ -15,8 +15,11 @@ class RegenerateCredentialParameters(Model): """The parameters used to regenerate the login credential. - :param name: Specifies name of the password which should be regenerated -- - password or password2. Possible values include: 'password', 'password2' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' :type name: str or ~azure.mgmt.containerregistry.v2017_10_01.models.PasswordName """ @@ -29,5 +32,6 @@ class RegenerateCredentialParameters(Model): 'name': {'key': 'name', 'type': 'PasswordName'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py new file mode 100644 index 000000000000..cc6a695c1180 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateCredentialParameters(Model): + """The parameters used to regenerate the login credential. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PasswordName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py index 16922f2dc754..64d644e1e1be 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py @@ -18,18 +18,20 @@ class Registry(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] - :param sku: The SKU of the container registry. + :param sku: Required. The SKU of the container registry. :type sku: ~azure.mgmt.containerregistry.v2017_10_01.models.Sku :ivar login_server: The URL that can be used to log into the container registry. @@ -81,12 +83,12 @@ class Registry(Resource): 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, } - def __init__(self, location, sku, tags=None, admin_user_enabled=False, storage_account=None): - super(Registry, self).__init__(location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(Registry, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.login_server = None self.creation_date = None self.provisioning_state = None self.status = None - self.admin_user_enabled = admin_user_enabled - self.storage_account = storage_account + self.admin_user_enabled = kwargs.get('admin_user_enabled', False) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py index 94b085994a2a..e71ee8881a9c 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py @@ -27,6 +27,7 @@ class RegistryListCredentialsResult(Model): 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, } - def __init__(self, username=None, passwords=None): - self.username = username - self.passwords = passwords + def __init__(self, **kwargs): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py new file mode 100644 index 000000000000..7c6381ae9aac --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryListCredentialsResult(Model): + """The response from the ListCredentials operation. + + :param username: The username for a container registry. + :type username: str + :param passwords: The list of passwords for a container registry. + :type passwords: + list[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, + } + + def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None: + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = username + self.passwords = passwords diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py index d83e4b3e1cd8..9d4a575eac04 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py @@ -18,11 +18,13 @@ class RegistryNameCheckRequest(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The name of the container registry. + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. :type name: str - :ivar type: The resource type of the container registry. This field must - be set to 'Microsoft.ContainerRegistry/registries'. Default value: - "Microsoft.ContainerRegistry/registries" . + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . :vartype type: str """ @@ -38,5 +40,6 @@ class RegistryNameCheckRequest(Model): type = "Microsoft.ContainerRegistry/registries" - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py new file mode 100644 index 000000000000..67f5ff9be671 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameCheckRequest(Model): + """A request to check whether a container registry name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. + :type name: str + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.ContainerRegistry/registries" + + def __init__(self, *, name: str, **kwargs) -> None: + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py index 526515a435f6..94345ba6d549 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py @@ -32,7 +32,8 @@ class RegistryNameStatus(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py new file mode 100644 index 000000000000..8b7b264c2d0d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameStatus(Model): + """The result of a request to check the availability of a container registry + name. + + :param name_available: The value that indicates whether the name is + available. + :type name_available: bool + :param reason: If any, the reason that the name is not available. + :type reason: str + :param message: If any, the error message that provides more detail for + the reason that the name is not available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py index fe0b33692387..0c66463a1ef3 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py @@ -28,6 +28,7 @@ class RegistryPassword(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, name=None, value=None): - self.name = name - self.value = value + def __init__(self, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py new file mode 100644 index 000000000000..7e49069eb5d2 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryPassword(Model): + """The login password for the container registry. + + :param name: The password name. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PasswordName + :param value: The password value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name=None, value: str=None, **kwargs) -> None: + super(RegistryPassword, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py new file mode 100644 index 000000000000..1508c03a9225 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Registry(Resource): + """An object that represents a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param sku: Required. The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2017_10_01.models.Sku + :ivar login_server: The URL that can be used to log into the container + registry. + :vartype login_server: str + :ivar creation_date: The creation date of the container registry in + ISO8601 format. + :vartype creation_date: datetime + :ivar provisioning_state: The provisioning state of the container registry + at the time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2017_10_01.models.Status + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. Default value: False . + :type admin_user_enabled: bool + :param storage_account: The properties of the storage account for the + container registry. Only applicable to Classic SKU. + :type storage_account: + ~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'login_server': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'login_server': {'key': 'properties.loginServer', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None: + super(Registry, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.login_server = None + self.creation_date = None + self.provisioning_state = None + self.status = None + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py index 7934b86a3cef..0a39b1291570 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py @@ -37,8 +37,9 @@ class RegistryUpdateParameters(Model): 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, } - def __init__(self, tags=None, sku=None, admin_user_enabled=None, storage_account=None): - self.tags = tags - self.sku = sku - self.admin_user_enabled = admin_user_enabled - self.storage_account = storage_account + def __init__(self, **kwargs): + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.admin_user_enabled = kwargs.get('admin_user_enabled', None) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py new file mode 100644 index 000000000000..0639f0c8f4c6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUpdateParameters(Model): + """The parameters for updating a container registry. + + :param tags: The tags for the container registry. + :type tags: dict[str, str] + :param sku: The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2017_10_01.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param storage_account: The parameters of a storage account for the + container registry. Only applicable to Classic SKU. If specified, the + storage account must be in the same physical location as the container + registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None: + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py index 368c09178a42..87346ec9933e 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py @@ -34,8 +34,9 @@ class RegistryUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self, name=None, limit=None, current_value=None, unit=None): - self.name = name - self.limit = limit - self.current_value = current_value - self.unit = unit + def __init__(self, **kwargs): + super(RegistryUsage, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.limit = kwargs.get('limit', None) + self.current_value = kwargs.get('current_value', None) + self.unit = kwargs.get('unit', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py index b084ef871028..c30676853b1a 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py @@ -24,5 +24,6 @@ class RegistryUsageListResult(Model): 'value': {'key': 'value', 'type': '[RegistryUsage]'}, } - def __init__(self, value=None): - self.value = value + def __init__(self, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py new file mode 100644 index 000000000000..9eab053f50a8 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsageListResult(Model): + """The result of a request to get container registry quota usages. + + :param value: The list of container registry quota usages. + :type value: + list[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py new file mode 100644 index 000000000000..22f745553ad1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsage(Model): + """The quota usage for a container registry. + + :param name: The name of the usage. + :type name: str + :param limit: The limit of the usage. + :type limit: long + :param current_value: The current value of the usage. + :type current_value: long + :param unit: The unit of measurement. Possible values include: 'Count', + 'Bytes' + :type unit: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryUsageUnit + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, limit: int=None, current_value: int=None, unit=None, **kwargs) -> None: + super(RegistryUsage, self).__init__(**kwargs) + self.name = name + self.limit = limit + self.current_value = current_value + self.unit = unit diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py index fd396e02303f..2c41180924e5 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py @@ -18,14 +18,16 @@ class Replication(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] @@ -58,7 +60,7 @@ class Replication(Resource): 'status': {'key': 'properties.status', 'type': 'Status'}, } - def __init__(self, location, tags=None): - super(Replication, self).__init__(location=location, tags=tags) + def __init__(self, **kwargs): + super(Replication, self).__init__(**kwargs) self.provisioning_state = None self.status = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py new file mode 100644 index 000000000000..045582df115c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Replication(Resource): + """An object that represents a replication for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the replication at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2017_10_01.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Replication, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.status = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py index 56446f4c5af0..003b15583a55 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py @@ -23,5 +23,6 @@ class ReplicationUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - self.tags = tags + def __init__(self, **kwargs): + super(ReplicationUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py new file mode 100644 index 000000000000..5497bcdbc1f7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ReplicationUpdateParameters(Model): + """The parameters for updating a replication. + + :param tags: The tags for the replication. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ReplicationUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py index 51a65142085c..e08090f53205 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py @@ -38,9 +38,10 @@ class Request(Model): 'useragent': {'key': 'useragent', 'type': 'str'}, } - def __init__(self, id=None, addr=None, host=None, method=None, useragent=None): - self.id = id - self.addr = addr - self.host = host - self.method = method - self.useragent = useragent + def __init__(self, **kwargs): + super(Request, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.addr = kwargs.get('addr', None) + self.host = kwargs.get('host', None) + self.method = kwargs.get('method', None) + self.useragent = kwargs.get('useragent', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py new file mode 100644 index 000000000000..f42dae28c955 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Request(Model): + """The request that generated the event. + + :param id: The ID of the request that initiated the event. + :type id: str + :param addr: The IP or hostname and possibly port of the client connection + that initiated the event. This is the RemoteAddr from the standard http + request. + :type addr: str + :param host: The externally accessible hostname of the registry instance, + as specified by the http host header on incoming requests. + :type host: str + :param method: The request method that generated the event. + :type method: str + :param useragent: The user agent header of the request. + :type useragent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'addr': {'key': 'addr', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'useragent': {'key': 'useragent', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, addr: str=None, host: str=None, method: str=None, useragent: str=None, **kwargs) -> None: + super(Request, self).__init__(**kwargs) + self.id = id + self.addr = addr + self.host = host + self.method = method + self.useragent = useragent diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py index b218c46aa3d1..3965a6f0cf40 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] @@ -46,9 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py new file mode 100644 index 000000000000..3a1d4bc4edd1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py index f29cecfc19b3..c0d18e913544 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py @@ -18,9 +18,11 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The SKU name of the container registry. Required for registry - creation. Possible values include: 'Classic', 'Basic', 'Standard', - 'Premium' + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Possible values include: 'Classic', 'Basic', + 'Standard', 'Premium' :type name: str or ~azure.mgmt.containerregistry.v2017_10_01.models.SkuName :ivar tier: The SKU tier based on the SKU name. Possible values include: @@ -39,6 +41,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py new file mode 100644 index 000000000000..9451e13be1fd --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Possible values include: 'Classic', 'Basic', + 'Standard', 'Premium' + :type name: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.SkuName + :ivar tier: The SKU tier based on the SKU name. Possible values include: + 'Classic', 'Basic', 'Standard', 'Premium' + :vartype tier: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py index ebf52c12ceac..132f4b2c1324 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py @@ -30,6 +30,7 @@ class Source(Model): 'instance_id': {'key': 'instanceID', 'type': 'str'}, } - def __init__(self, addr=None, instance_id=None): - self.addr = addr - self.instance_id = instance_id + def __init__(self, **kwargs): + super(Source, self).__init__(**kwargs) + self.addr = kwargs.get('addr', None) + self.instance_id = kwargs.get('instance_id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py new file mode 100644 index 000000000000..5aadcd407862 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Source(Model): + """The registry node that generated the event. Put differently, while the + actor initiates the event, the source generates it. + + :param addr: The IP or hostname and the port of the registry node that + generated the event. Generally, this will be resolved by os.Hostname() + along with the running port. + :type addr: str + :param instance_id: The running instance of an application. Changes after + each restart. + :type instance_id: str + """ + + _attribute_map = { + 'addr': {'key': 'addr', 'type': 'str'}, + 'instance_id': {'key': 'instanceID', 'type': 'str'}, + } + + def __init__(self, *, addr: str=None, instance_id: str=None, **kwargs) -> None: + super(Source, self).__init__(**kwargs) + self.addr = addr + self.instance_id = instance_id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py index af9d5066c871..76444c500634 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py @@ -40,7 +40,8 @@ class Status(Model): 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, } - def __init__(self): + def __init__(self, **kwargs): + super(Status, self).__init__(**kwargs) self.display_status = None self.message = None self.timestamp = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py new file mode 100644 index 000000000000..1f4611c49912 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Status(Model): + """The status of an Azure resource at the time the operation was called. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_status: The short label for the status. + :vartype display_status: str + :ivar message: The detailed message for the status, including alerts and + error messages. + :vartype message: str + :ivar timestamp: The timestamp when the status was changed to the current + value. + :vartype timestamp: datetime + """ + + _validation = { + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(Status, self).__init__(**kwargs) + self.display_status = None + self.message = None + self.timestamp = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py index b9b4af57bfda..0541b7651cbd 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py @@ -16,7 +16,9 @@ class StorageAccountProperties(Model): """The properties of a storage account for a container registry. Only applicable to Classic SKU. - :param id: The resource ID of the storage account. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The resource ID of the storage account. :type id: str """ @@ -28,5 +30,6 @@ class StorageAccountProperties(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - self.id = id + def __init__(self, **kwargs): + super(StorageAccountProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py new file mode 100644 index 000000000000..5714fde0fcd2 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountProperties(Model): + """The properties of a storage account for a container registry. Only + applicable to Classic SKU. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The resource ID of the storage account. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(StorageAccountProperties, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py index d980bbd4af9b..a9bb2a92970d 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py @@ -42,11 +42,12 @@ class Target(Model): 'tag': {'key': 'tag', 'type': 'str'}, } - def __init__(self, media_type=None, size=None, digest=None, length=None, repository=None, url=None, tag=None): - self.media_type = media_type - self.size = size - self.digest = digest - self.length = length - self.repository = repository - self.url = url - self.tag = tag + def __init__(self, **kwargs): + super(Target, self).__init__(**kwargs) + self.media_type = kwargs.get('media_type', None) + self.size = kwargs.get('size', None) + self.digest = kwargs.get('digest', None) + self.length = kwargs.get('length', None) + self.repository = kwargs.get('repository', None) + self.url = kwargs.get('url', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py new file mode 100644 index 000000000000..013f2d1bedeb --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Target(Model): + """The target of the event. + + :param media_type: The MIME type of the referenced object. + :type media_type: str + :param size: The number of bytes of the content. Same as Length field. + :type size: long + :param digest: The digest of the content, as defined by the Registry V2 + HTTP API Specification. + :type digest: str + :param length: The number of bytes of the content. Same as Size field. + :type length: long + :param repository: The repository name. + :type repository: str + :param url: The direct URL to the content. + :type url: str + :param tag: The tag name. + :type tag: str + """ + + _attribute_map = { + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'digest': {'key': 'digest', 'type': 'str'}, + 'length': {'key': 'length', 'type': 'long'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, *, media_type: str=None, size: int=None, digest: str=None, length: int=None, repository: str=None, url: str=None, tag: str=None, **kwargs) -> None: + super(Target, self).__init__(**kwargs) + self.media_type = media_type + self.size = size + self.digest = digest + self.length = length + self.repository = repository + self.url = url + self.tag = tag diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py index 4b38f6875826..9777a3f7c907 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py @@ -18,14 +18,16 @@ class Webhook(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The resource ID. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str - :param location: The location of the resource. This cannot be changed - after the resource is created. + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. :type location: str :param tags: The tags of the resource. :type tags: dict[str, str] @@ -38,8 +40,8 @@ class Webhook(Resource): 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. :type scope: str - :param actions: The list of actions that trigger the webhook to post - notifications. + :param actions: Required. The list of actions that trigger the webhook to + post notifications. :type actions: list[str or ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookAction] :ivar provisioning_state: The provisioning state of the webhook at the @@ -70,9 +72,9 @@ class Webhook(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, actions, tags=None, status=None, scope=None): - super(Webhook, self).__init__(location=location, tags=tags) - self.status = status - self.scope = scope - self.actions = actions + def __init__(self, **kwargs): + super(Webhook, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) self.provisioning_state = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py index 38cc4032fdab..3194208c2309 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py @@ -15,12 +15,15 @@ class WebhookCreateParameters(Model): """The parameters for creating a webhook. + All required parameters must be populated in order to send to Azure. + :param tags: The tags for the webhook. :type tags: dict[str, str] - :param location: The location of the webhook. This cannot be changed after - the resource is created. + :param location: Required. The location of the webhook. This cannot be + changed after the resource is created. :type location: str - :param service_uri: The service URI for the webhook to post notifications. + :param service_uri: Required. The service URI for the webhook to post + notifications. :type service_uri: str :param custom_headers: Custom headers that will be added to the webhook notifications. @@ -34,8 +37,8 @@ class WebhookCreateParameters(Model): 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. :type scope: str - :param actions: The list of actions that trigger the webhook to post - notifications. + :param actions: Required. The list of actions that trigger the webhook to + post notifications. :type actions: list[str or ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookAction] """ @@ -56,11 +59,12 @@ class WebhookCreateParameters(Model): 'actions': {'key': 'properties.actions', 'type': '[str]'}, } - def __init__(self, location, service_uri, actions, tags=None, custom_headers=None, status=None, scope=None): - self.tags = tags - self.location = location - self.service_uri = service_uri - self.custom_headers = custom_headers - self.status = status - self.scope = scope - self.actions = actions + def __init__(self, **kwargs): + super(WebhookCreateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py new file mode 100644 index 000000000000..4278678a34ca --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookCreateParameters(Model): + """The parameters for creating a webhook. + + All required parameters must be populated in order to send to Azure. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param location: Required. The location of the webhook. This cannot be + changed after the resource is created. + :type location: str + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookAction] + """ + + _validation = { + 'location': {'required': True}, + 'service_uri': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, location: str, service_uri: str, actions, tags=None, custom_headers=None, status=None, scope: str=None, **kwargs) -> None: + super(WebhookCreateParameters, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.service_uri = service_uri + self.custom_headers = custom_headers + self.status = status + self.scope = scope + self.actions = actions diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py new file mode 100644 index 000000000000..cde2a32a8c43 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Webhook(Resource): + """An object that represents a webhook for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookAction] + :ivar provisioning_state: The provisioning state of the webhook at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'actions': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, actions, tags=None, status=None, scope: str=None, **kwargs) -> None: + super(Webhook, self).__init__(location=location, tags=tags, **kwargs) + self.status = status + self.scope = scope + self.actions = actions + self.provisioning_state = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py index 37be6ad4aa46..120a18bd2506 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py @@ -46,10 +46,11 @@ class WebhookUpdateParameters(Model): 'actions': {'key': 'properties.actions', 'type': '[str]'}, } - def __init__(self, tags=None, service_uri=None, custom_headers=None, status=None, scope=None, actions=None): - self.tags = tags - self.service_uri = service_uri - self.custom_headers = custom_headers - self.status = status - self.scope = scope - self.actions = actions + def __init__(self, **kwargs): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py new file mode 100644 index 000000000000..8e35f6bc9407 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookUpdateParameters(Model): + """The parameters for updating a webhook. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param service_uri: The service URI for the webhook to post notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: The list of actions that trigger the webhook to post + notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookAction] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, service_uri: str=None, custom_headers=None, status=None, scope: str=None, actions=None, **kwargs) -> None: + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.service_uri = service_uri + self.custom_headers = custom_headers + self.status = status + self.scope = scope + self.actions = actions diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py index 82c22552958c..fe098496de23 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-10-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.ContainerRegistry/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -79,7 +79,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -97,3 +97,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py index 57419bb0dcaf..1d9603860137 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py @@ -12,7 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +24,7 @@ class RegistriesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-10-01". """ @@ -60,7 +61,7 @@ def check_name_availability( registry_name_check_request = models.RegistryNameCheckRequest(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -86,7 +87,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -103,6 +104,7 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability'} def get( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -124,7 +126,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -148,7 +150,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -165,31 +167,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} - def create( - self, resource_group_name, registry_name, registry, custom_headers=None, raw=False, **operation_config): - """Creates a container registry with the specified parameters. - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param registry_name: The name of the container registry. - :type registry_name: str - :param registry: The parameters for creating a container registry. - :type registry: - ~azure.mgmt.containerregistry.v2017_10_01.models.Registry - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Registry or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, registry_name, registry, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -215,33 +199,64 @@ def create( body_content = self._serialize.body(registry, 'Registry') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) + if response.status_code == 201: + deserialized = self._deserialize('Registry', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized - deserialized = None + def create( + self, resource_group_name, registry_name, registry, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a container registry with the specified parameters. - if response.status_code == 200: - deserialized = self._deserialize('Registry', response) - if response.status_code == 201: - deserialized = self._deserialize('Registry', response) + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param registry: The parameters for creating a container registry. + :type registry: + ~azure.mgmt.containerregistry.v2017_10_01.models.Registry + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Registry or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Registry]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry=registry, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Registry', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -249,37 +264,20 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} - def delete( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Deletes a container registry. - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param registry_name: The name of the container registry. - :type registry_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -302,66 +300,65 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def update( - self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, **operation_config): - """Updates a container registry with the specified parameters. + def delete( + self, resource_group_name, registry_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a container registry. :param resource_group_name: The name of the resource group to which the container registry belongs. :type resource_group_name: str :param registry_name: The name of the container registry. :type registry_name: str - :param registry_update_parameters: The parameters for updating a - container registry. - :type registry_update_parameters: - ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Registry or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] - or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} + + + def _update_initial( + self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -387,33 +384,65 @@ def update( body_content = self._serialize.body(registry_update_parameters, 'RegistryUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) + if response.status_code == 201: + deserialized = self._deserialize('Registry', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized + + def update( + self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a container registry with the specified parameters. - deserialized = None + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param registry_update_parameters: The parameters for updating a + container registry. + :type registry_update_parameters: + ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Registry or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Registry]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry_update_parameters=registry_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if response.status_code == 200: - deserialized = self._deserialize('Registry', response) - if response.status_code == 201: - deserialized = self._deserialize('Registry', response) + def get_long_running_output(response): + deserialized = self._deserialize('Registry', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -421,16 +450,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -453,7 +480,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') @@ -481,7 +508,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -499,6 +526,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -518,7 +546,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -545,7 +573,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -563,6 +591,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries'} def list_credentials( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -586,7 +615,7 @@ def list_credentials( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials' + url = self.list_credentials.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -610,7 +639,7 @@ def list_credentials( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -627,6 +656,7 @@ def list_credentials( return client_raw_response return deserialized + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials'} def regenerate_credential( self, resource_group_name, registry_name, name, custom_headers=None, raw=False, **operation_config): @@ -658,7 +688,7 @@ def regenerate_credential( regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential' + url = self.regenerate_credential.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -686,7 +716,7 @@ def regenerate_credential( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -703,6 +733,7 @@ def regenerate_credential( return client_raw_response return deserialized + regenerate_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential'} def list_usages( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -725,7 +756,7 @@ def list_usages( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages' + url = self.list_usages.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -749,7 +780,7 @@ def list_usages( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -766,3 +797,4 @@ def list_usages( return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py index c118b31b2f2b..9293f57f62fc 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py @@ -12,7 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +24,7 @@ class ReplicationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-10-01". """ @@ -60,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -85,7 +86,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -102,38 +103,15 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} - def create( - self, resource_group_name, registry_name, replication_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - """Creates a replication for a container registry with the specified - parameters. - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param registry_name: The name of the container registry. - :type registry_name: str - :param replication_name: The name of the replication. - :type replication_name: str - :param location: The location of the resource. This cannot be changed - after the resource is created. - :type location: str - :param tags: The tags of the resource. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Replication - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Replication] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, registry_name, replication_name, location, tags=None, custom_headers=None, raw=False, **operation_config): replication = models.Replication(location=location, tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -160,54 +138,32 @@ def create( body_content = self._serialize.body(replication, 'Replication') # Construct and send request - def long_running_send(): - - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Replication', response) - if response.status_code == 201: - deserialized = self._deserialize('Replication', response) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + deserialized = None - return deserialized + if response.status_code == 200: + deserialized = self._deserialize('Replication', response) + if response.status_code == 201: + deserialized = self._deserialize('Replication', response) if raw: - response = long_running_send() - return get_long_running_output(response) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + return deserialized - def delete( - self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, **operation_config): - """Deletes a replication from a container registry. + def create( + self, resource_group_name, registry_name, replication_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a replication for a container registry with the specified + parameters. :param resource_group_name: The name of the resource group to which the container registry belongs. @@ -216,17 +172,58 @@ def delete( :type registry_name: str :param replication_name: The name of the replication. :type replication_name: str + :param location: The location of the resource. This cannot be changed + after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Replication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Replication]] :raises: :class:`CloudError` """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -250,45 +247,21 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def update( - self, resource_group_name, registry_name, replication_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Updates a replication for a container registry with the specified - parameters. + def delete( + self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a replication from a container registry. :param resource_group_name: The name of the resource group to which the container registry belongs. @@ -297,22 +270,47 @@ def update( :type registry_name: str :param replication_name: The name of the replication. :type replication_name: str - :param tags: The tags for the replication. - :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Replication - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Replication] - or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + + def _update_initial( + self, resource_group_name, registry_name, replication_name, tags=None, custom_headers=None, raw=False, **operation_config): replication_update_parameters = models.ReplicationUpdateParameters(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -339,33 +337,67 @@ def update( body_content = self._serialize.body(replication_update_parameters, 'ReplicationUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + deserialized = None - def get_long_running_status(status_link, headers=None): + if response.status_code == 200: + deserialized = self._deserialize('Replication', response) + if response.status_code == 201: + deserialized = self._deserialize('Replication', response) - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - def get_long_running_output(response): + return deserialized - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + def update( + self, resource_group_name, registry_name, replication_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a replication for a container registry with the specified + parameters. - deserialized = None + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param replication_name: The name of the replication. + :type replication_name: str + :param tags: The tags for the replication. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Replication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Replication]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if response.status_code == 200: - deserialized = self._deserialize('Replication', response) - if response.status_code == 201: - deserialized = self._deserialize('Replication', response) + def get_long_running_output(response): + deserialized = self._deserialize('Replication', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -373,16 +405,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} def list( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +437,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -436,7 +466,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -454,3 +484,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py index b648d046845c..7424d54d20f3 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py @@ -12,7 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,7 +24,7 @@ class WebhooksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The client API version. Constant value: "2017-10-01". """ @@ -60,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -85,7 +86,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -102,35 +103,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} - def create( - self, resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers=None, raw=False, **operation_config): - """Creates a webhook for a container registry with the specified - parameters. - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param registry_name: The name of the container registry. - :type registry_name: str - :param webhook_name: The name of the webhook. - :type webhook_name: str - :param webhook_create_parameters: The parameters for creating a - webhook. - :type webhook_create_parameters: - ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookCreateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Webhook or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + url = self.create.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -157,54 +136,32 @@ def create( body_content = self._serialize.body(webhook_create_parameters, 'WebhookCreateParameters') # Construct and send request - def long_running_send(): - - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code == 200: - deserialized = self._deserialize('Webhook', response) - if response.status_code == 201: - deserialized = self._deserialize('Webhook', response) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + deserialized = None - return deserialized + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) if raw: - response = long_running_send() - return get_long_running_output(response) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + return deserialized - def delete( - self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): - """Deletes a webhook from a container registry. + def create( + self, resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a webhook for a container registry with the specified + parameters. :param resource_group_name: The name of the resource group to which the container registry belongs. @@ -213,17 +170,56 @@ def delete( :type registry_name: str :param webhook_name: The name of the webhook. :type webhook_name: str + :param webhook_create_parameters: The parameters for creating a + webhook. + :type webhook_create_parameters: + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookCreateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Webhook or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook]] :raises: :class:`CloudError` """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + webhook_create_parameters=webhook_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -247,44 +243,21 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def update( - self, resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers=None, raw=False, **operation_config): - """Updates a webhook with the specified parameters. + def delete( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a webhook from a container registry. :param resource_group_name: The name of the resource group to which the container registry belongs. @@ -293,22 +266,45 @@ def update( :type registry_name: str :param webhook_name: The name of the webhook. :type webhook_name: str - :param webhook_update_parameters: The parameters for updating a - webhook. - :type webhook_update_parameters: - ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Webhook or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook] - or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + + def _update_initial( + self, resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}' + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -335,33 +331,68 @@ def update( body_content = self._serialize.body(webhook_update_parameters, 'WebhookUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized + + def update( + self, resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a webhook with the specified parameters. - deserialized = None + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param webhook_update_parameters: The parameters for updating a + webhook. + :type webhook_update_parameters: + ~azure.mgmt.containerregistry.v2017_10_01.models.WebhookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Webhook or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + webhook_update_parameters=webhook_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if response.status_code == 200: - deserialized = self._deserialize('Webhook', response) - if response.status_code == 201: - deserialized = self._deserialize('Webhook', response) + def get_long_running_output(response): + deserialized = self._deserialize('Webhook', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -369,16 +400,14 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} def list( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): @@ -403,7 +432,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -432,7 +461,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -450,6 +479,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks'} def ping( self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +503,7 @@ def ping( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping' + url = self.ping.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -498,7 +528,7 @@ def ping( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -515,6 +545,7 @@ def ping( return client_raw_response return deserialized + ping.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping'} def get_callback_config( self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): @@ -540,7 +571,7 @@ def get_callback_config( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig' + url = self.get_callback_config.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -565,7 +596,7 @@ def get_callback_config( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -582,6 +613,7 @@ def get_callback_config( return client_raw_response return deserialized + get_callback_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig'} def list_events( self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): @@ -608,7 +640,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents' + url = self.list_events.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -638,7 +670,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -656,3 +688,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py new file mode 100644 index 000000000000..511d3d37a4aa --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .container_registry_management_client import ContainerRegistryManagementClient +from .version import VERSION + +__all__ = ['ContainerRegistryManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py new file mode 100644 index 000000000000..0d03e81c342a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.registries_operations import RegistriesOperations +from .operations.operations import Operations +from .operations.replications_operations import ReplicationsOperations +from .operations.webhooks_operations import WebhooksOperations +from .operations.builds_operations import BuildsOperations +from .operations.build_steps_operations import BuildStepsOperations +from .operations.build_tasks_operations import BuildTasksOperations +from . import models + + +class ContainerRegistryManagementClientConfiguration(AzureConfiguration): + """Configuration for ContainerRegistryManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ContainerRegistryManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-containerregistry/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations + :ivar builds: Builds operations + :vartype builds: azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildsOperations + :ivar build_steps: BuildSteps operations + :vartype build_steps: azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildStepsOperations + :ivar build_tasks: BuildTasks operations + :vartype build_tasks: azure.mgmt.containerregistry.v2018_02_01_preview.operations.BuildTasksOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) + super(ContainerRegistryManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.registries = RegistriesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.replications = ReplicationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.webhooks = WebhooksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.builds = BuildsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.build_steps = BuildStepsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.build_tasks = BuildTasksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py new file mode 100644 index 000000000000..598fadcfddbb --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py @@ -0,0 +1,237 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .registry_name_check_request_py3 import RegistryNameCheckRequest + from .registry_name_status_py3 import RegistryNameStatus + from .operation_display_definition_py3 import OperationDisplayDefinition + from .operation_definition_py3 import OperationDefinition + from .sku_py3 import Sku + from .status_py3 import Status + from .storage_account_properties_py3 import StorageAccountProperties + from .registry_py3 import Registry + from .registry_update_parameters_py3 import RegistryUpdateParameters + from .registry_password_py3 import RegistryPassword + from .registry_list_credentials_result_py3 import RegistryListCredentialsResult + from .regenerate_credential_parameters_py3 import RegenerateCredentialParameters + from .registry_usage_py3 import RegistryUsage + from .registry_usage_list_result_py3 import RegistryUsageListResult + from .replication_py3 import Replication + from .replication_update_parameters_py3 import ReplicationUpdateParameters + from .webhook_py3 import Webhook + from .webhook_create_parameters_py3 import WebhookCreateParameters + from .webhook_update_parameters_py3 import WebhookUpdateParameters + from .event_info_py3 import EventInfo + from .callback_config_py3 import CallbackConfig + from .target_py3 import Target + from .request_py3 import Request + from .actor_py3 import Actor + from .source_py3 import Source + from .event_content_py3 import EventContent + from .event_request_message_py3 import EventRequestMessage + from .event_response_message_py3 import EventResponseMessage + from .event_py3 import Event + from .resource_py3 import Resource + from .image_descriptor_py3 import ImageDescriptor + from .image_update_trigger_py3 import ImageUpdateTrigger + from .git_commit_trigger_py3 import GitCommitTrigger + from .platform_properties_py3 import PlatformProperties + from .build_py3 import Build + from .build_filter_py3 import BuildFilter + from .build_update_parameters_py3 import BuildUpdateParameters + from .build_get_log_result_py3 import BuildGetLogResult + from .build_step_properties_py3 import BuildStepProperties + from .build_step_py3 import BuildStep + from .build_step_properties_update_parameters_py3 import BuildStepPropertiesUpdateParameters + from .build_step_update_parameters_py3 import BuildStepUpdateParameters + from .build_argument_py3 import BuildArgument + from .source_control_auth_info_py3 import SourceControlAuthInfo + from .source_repository_properties_py3 import SourceRepositoryProperties + from .build_task_py3 import BuildTask + from .build_task_filter_py3 import BuildTaskFilter + from .source_repository_update_parameters_py3 import SourceRepositoryUpdateParameters + from .build_task_update_parameters_py3 import BuildTaskUpdateParameters + from .queue_build_request_py3 import QueueBuildRequest + from .source_upload_definition_py3 import SourceUploadDefinition + from .proxy_resource_py3 import ProxyResource + from .base_image_dependency_py3 import BaseImageDependency + from .docker_build_step_py3 import DockerBuildStep + from .docker_build_step_update_parameters_py3 import DockerBuildStepUpdateParameters + from .build_task_build_request_py3 import BuildTaskBuildRequest + from .quick_build_request_py3 import QuickBuildRequest +except (SyntaxError, ImportError): + from .registry_name_check_request import RegistryNameCheckRequest + from .registry_name_status import RegistryNameStatus + from .operation_display_definition import OperationDisplayDefinition + from .operation_definition import OperationDefinition + from .sku import Sku + from .status import Status + from .storage_account_properties import StorageAccountProperties + from .registry import Registry + from .registry_update_parameters import RegistryUpdateParameters + from .registry_password import RegistryPassword + from .registry_list_credentials_result import RegistryListCredentialsResult + from .regenerate_credential_parameters import RegenerateCredentialParameters + from .registry_usage import RegistryUsage + from .registry_usage_list_result import RegistryUsageListResult + from .replication import Replication + from .replication_update_parameters import ReplicationUpdateParameters + from .webhook import Webhook + from .webhook_create_parameters import WebhookCreateParameters + from .webhook_update_parameters import WebhookUpdateParameters + from .event_info import EventInfo + from .callback_config import CallbackConfig + from .target import Target + from .request import Request + from .actor import Actor + from .source import Source + from .event_content import EventContent + from .event_request_message import EventRequestMessage + from .event_response_message import EventResponseMessage + from .event import Event + from .resource import Resource + from .image_descriptor import ImageDescriptor + from .image_update_trigger import ImageUpdateTrigger + from .git_commit_trigger import GitCommitTrigger + from .platform_properties import PlatformProperties + from .build import Build + from .build_filter import BuildFilter + from .build_update_parameters import BuildUpdateParameters + from .build_get_log_result import BuildGetLogResult + from .build_step_properties import BuildStepProperties + from .build_step import BuildStep + from .build_step_properties_update_parameters import BuildStepPropertiesUpdateParameters + from .build_step_update_parameters import BuildStepUpdateParameters + from .build_argument import BuildArgument + from .source_control_auth_info import SourceControlAuthInfo + from .source_repository_properties import SourceRepositoryProperties + from .build_task import BuildTask + from .build_task_filter import BuildTaskFilter + from .source_repository_update_parameters import SourceRepositoryUpdateParameters + from .build_task_update_parameters import BuildTaskUpdateParameters + from .queue_build_request import QueueBuildRequest + from .source_upload_definition import SourceUploadDefinition + from .proxy_resource import ProxyResource + from .base_image_dependency import BaseImageDependency + from .docker_build_step import DockerBuildStep + from .docker_build_step_update_parameters import DockerBuildStepUpdateParameters + from .build_task_build_request import BuildTaskBuildRequest + from .quick_build_request import QuickBuildRequest +from .registry_paged import RegistryPaged +from .operation_definition_paged import OperationDefinitionPaged +from .replication_paged import ReplicationPaged +from .webhook_paged import WebhookPaged +from .event_paged import EventPaged +from .build_paged import BuildPaged +from .build_step_paged import BuildStepPaged +from .build_argument_paged import BuildArgumentPaged +from .build_task_paged import BuildTaskPaged +from .container_registry_management_client_enums import ( + SkuName, + SkuTier, + ProvisioningState, + PasswordName, + RegistryUsageUnit, + WebhookStatus, + WebhookAction, + BuildStatus, + BuildType, + OsType, + BuildTaskStatus, + SourceControlType, + TokenType, + BaseImageDependencyType, + BaseImageTriggerType, +) + +__all__ = [ + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'OperationDisplayDefinition', + 'OperationDefinition', + 'Sku', + 'Status', + 'StorageAccountProperties', + 'Registry', + 'RegistryUpdateParameters', + 'RegistryPassword', + 'RegistryListCredentialsResult', + 'RegenerateCredentialParameters', + 'RegistryUsage', + 'RegistryUsageListResult', + 'Replication', + 'ReplicationUpdateParameters', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', + 'EventInfo', + 'CallbackConfig', + 'Target', + 'Request', + 'Actor', + 'Source', + 'EventContent', + 'EventRequestMessage', + 'EventResponseMessage', + 'Event', + 'Resource', + 'ImageDescriptor', + 'ImageUpdateTrigger', + 'GitCommitTrigger', + 'PlatformProperties', + 'Build', + 'BuildFilter', + 'BuildUpdateParameters', + 'BuildGetLogResult', + 'BuildStepProperties', + 'BuildStep', + 'BuildStepPropertiesUpdateParameters', + 'BuildStepUpdateParameters', + 'BuildArgument', + 'SourceControlAuthInfo', + 'SourceRepositoryProperties', + 'BuildTask', + 'BuildTaskFilter', + 'SourceRepositoryUpdateParameters', + 'BuildTaskUpdateParameters', + 'QueueBuildRequest', + 'SourceUploadDefinition', + 'ProxyResource', + 'BaseImageDependency', + 'DockerBuildStep', + 'DockerBuildStepUpdateParameters', + 'BuildTaskBuildRequest', + 'QuickBuildRequest', + 'RegistryPaged', + 'OperationDefinitionPaged', + 'ReplicationPaged', + 'WebhookPaged', + 'EventPaged', + 'BuildPaged', + 'BuildStepPaged', + 'BuildArgumentPaged', + 'BuildTaskPaged', + 'SkuName', + 'SkuTier', + 'ProvisioningState', + 'PasswordName', + 'RegistryUsageUnit', + 'WebhookStatus', + 'WebhookAction', + 'BuildStatus', + 'BuildType', + 'OsType', + 'BuildTaskStatus', + 'SourceControlType', + 'TokenType', + 'BaseImageDependencyType', + 'BaseImageTriggerType', +] diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py new file mode 100644 index 000000000000..a662f9008a31 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Actor(Model): + """The agent that initiated the event. For most situations, this could be from + the authorization context of the request. + + :param name: The subject or username associated with the request context + that generated the event. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Actor, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py new file mode 100644 index 000000000000..fdd8b96dda52 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Actor(Model): + """The agent that initiated the event. For most situations, this could be from + the authorization context of the request. + + :param name: The subject or username associated with the request context + that generated the event. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(Actor, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py new file mode 100644 index 000000000000..69685435853f --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BaseImageDependency(Model): + """Properties that describe a base image dependency. + + :param type: The type of the base image dependency. Possible values + include: 'BuildTime', 'RunTime' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageDependencyType + :param registry: The registry login server. + :type registry: str + :param repository: The repository name. + :type repository: str + :param tag: The tag name. + :type tag: str + :param digest: The sha256-based digest of the image manifest. + :type digest: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'registry': {'key': 'registry', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageDependency, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.registry = kwargs.get('registry', None) + self.repository = kwargs.get('repository', None) + self.tag = kwargs.get('tag', None) + self.digest = kwargs.get('digest', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py new file mode 100644 index 000000000000..994b57cdf60c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BaseImageDependency(Model): + """Properties that describe a base image dependency. + + :param type: The type of the base image dependency. Possible values + include: 'BuildTime', 'RunTime' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageDependencyType + :param registry: The registry login server. + :type registry: str + :param repository: The repository name. + :type repository: str + :param tag: The tag name. + :type tag: str + :param digest: The sha256-based digest of the image manifest. + :type digest: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'registry': {'key': 'registry', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'str'}, + } + + def __init__(self, *, type=None, registry: str=None, repository: str=None, tag: str=None, digest: str=None, **kwargs) -> None: + super(BaseImageDependency, self).__init__(**kwargs) + self.type = type + self.registry = registry + self.repository = repository + self.tag = tag + self.digest = digest diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py new file mode 100644 index 000000000000..83d35d835fc5 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Build(ProxyResource): + """Build resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param build_id: The unique identifier for the build. + :type build_id: str + :param status: The current status of the build. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStatus + :param last_updated_time: The last updated time for the build. + :type last_updated_time: datetime + :param build_type: The type of build. Possible values include: + 'AutoBuild', 'QuickBuild' + :type build_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildType + :param create_time: The time the build was created. + :type create_time: datetime + :param start_time: The time the build started. + :type start_time: datetime + :param finish_time: The time the build finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + build. + :type output_images: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageDescriptor] + :param build_task: The build task with which the build was started. + :type build_task: str + :param image_update_trigger: The image update trigger that caused the + build. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageUpdateTrigger + :param git_commit_trigger: The git commit trigger that caused the build. + :type git_commit_trigger: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.GitCommitTrigger + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param platform: The platform properties against which the build will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param provisioning_state: The provisioning state of a build. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'build_type': {'key': 'properties.buildType', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, + 'output_images': {'key': 'properties.outputImages', 'type': '[ImageDescriptor]'}, + 'build_task': {'key': 'properties.buildTask', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'git_commit_trigger': {'key': 'properties.gitCommitTrigger', 'type': 'GitCommitTrigger'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Build, self).__init__(**kwargs) + self.build_id = kwargs.get('build_id', None) + self.status = kwargs.get('status', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.build_type = kwargs.get('build_type', None) + self.create_time = kwargs.get('create_time', None) + self.start_time = kwargs.get('start_time', None) + self.finish_time = kwargs.get('finish_time', None) + self.output_images = kwargs.get('output_images', None) + self.build_task = kwargs.get('build_task', None) + self.image_update_trigger = kwargs.get('image_update_trigger', None) + self.git_commit_trigger = kwargs.get('git_commit_trigger', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.platform = kwargs.get('platform', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py new file mode 100644 index 000000000000..d10426bcada2 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildArgument(Model): + """Properties of a build argument. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The type of the argument. Default value: + "DockerBuildArgument" . + :vartype type: str + :param name: Required. The name of the argument. + :type name: str + :param value: Required. The value of the argument. + :type value: str + :param is_secret: Flag to indicate whether the argument represents a + secret and want to be removed from build logs. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + type = "DockerBuildArgument" + + def __init__(self, **kwargs): + super(BuildArgument, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py new file mode 100644 index 000000000000..91d532f13cf8 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BuildArgumentPaged(Paged): + """ + A paging container for iterating over a list of :class:`BuildArgument ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BuildArgument]'} + } + + def __init__(self, *args, **kwargs): + + super(BuildArgumentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py new file mode 100644 index 000000000000..758f5fd9b2e8 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildArgument(Model): + """Properties of a build argument. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Required. The type of the argument. Default value: + "DockerBuildArgument" . + :vartype type: str + :param name: Required. The name of the argument. + :type name: str + :param value: Required. The value of the argument. + :type value: str + :param is_secret: Flag to indicate whether the argument represents a + secret and want to be removed from build logs. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'type': {'required': True, 'constant': True}, + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + type = "DockerBuildArgument" + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(BuildArgument, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py new file mode 100644 index 000000000000..f0ea5eacbfed --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildFilter(Model): + """Properties that are enabled for Odata querying. + + :param build_id: The unique identifier for the build. + :type build_id: str + :param build_type: The type of build. Possible values include: + 'AutoBuild', 'QuickBuild' + :type build_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildType + :param status: The current status of the build. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStatus + :param create_time: The create time for a build. + :type create_time: datetime + :param finish_time: The time the build finished. + :type finish_time: datetime + :param output_image_names: The list of all images that were generated from + the build. + :type output_image_names: list[str] + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param build_task_name: The name of the build task that the build + corresponds to. + :type build_task_name: str + """ + + _attribute_map = { + 'build_id': {'key': 'buildId', 'type': 'str'}, + 'build_type': {'key': 'buildType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_names': {'key': 'outputImageNames', 'type': '[str]'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'build_task_name': {'key': 'buildTaskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BuildFilter, self).__init__(**kwargs) + self.build_id = kwargs.get('build_id', None) + self.build_type = kwargs.get('build_type', None) + self.status = kwargs.get('status', None) + self.create_time = kwargs.get('create_time', None) + self.finish_time = kwargs.get('finish_time', None) + self.output_image_names = kwargs.get('output_image_names', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + self.build_task_name = kwargs.get('build_task_name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py new file mode 100644 index 000000000000..314f0880526d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildFilter(Model): + """Properties that are enabled for Odata querying. + + :param build_id: The unique identifier for the build. + :type build_id: str + :param build_type: The type of build. Possible values include: + 'AutoBuild', 'QuickBuild' + :type build_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildType + :param status: The current status of the build. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStatus + :param create_time: The create time for a build. + :type create_time: datetime + :param finish_time: The time the build finished. + :type finish_time: datetime + :param output_image_names: The list of all images that were generated from + the build. + :type output_image_names: list[str] + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param build_task_name: The name of the build task that the build + corresponds to. + :type build_task_name: str + """ + + _attribute_map = { + 'build_id': {'key': 'buildId', 'type': 'str'}, + 'build_type': {'key': 'buildType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_names': {'key': 'outputImageNames', 'type': '[str]'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'build_task_name': {'key': 'buildTaskName', 'type': 'str'}, + } + + def __init__(self, *, build_id: str=None, build_type=None, status=None, create_time=None, finish_time=None, output_image_names=None, is_archive_enabled: bool=None, build_task_name: str=None, **kwargs) -> None: + super(BuildFilter, self).__init__(**kwargs) + self.build_id = build_id + self.build_type = build_type + self.status = status + self.create_time = create_time + self.finish_time = finish_time + self.output_image_names = output_image_names + self.is_archive_enabled = is_archive_enabled + self.build_task_name = build_task_name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py new file mode 100644 index 000000000000..7ad007ed3ef0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a azure container registry build. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BuildGetLogResult, self).__init__(**kwargs) + self.log_link = kwargs.get('log_link', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py new file mode 100644 index 000000000000..9bac641e9b17 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a azure container registry build. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, *, log_link: str=None, **kwargs) -> None: + super(BuildGetLogResult, self).__init__(**kwargs) + self.log_link = log_link diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py new file mode 100644 index 000000000000..bc1c75c4bfcf --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BuildPaged(Paged): + """ + A paging container for iterating over a list of :class:`Build ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Build]'} + } + + def __init__(self, *args, **kwargs): + + super(BuildPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py new file mode 100644 index 000000000000..1b69511e16d0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Build(ProxyResource): + """Build resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param build_id: The unique identifier for the build. + :type build_id: str + :param status: The current status of the build. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStatus + :param last_updated_time: The last updated time for the build. + :type last_updated_time: datetime + :param build_type: The type of build. Possible values include: + 'AutoBuild', 'QuickBuild' + :type build_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildType + :param create_time: The time the build was created. + :type create_time: datetime + :param start_time: The time the build started. + :type start_time: datetime + :param finish_time: The time the build finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + build. + :type output_images: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageDescriptor] + :param build_task: The build task with which the build was started. + :type build_task: str + :param image_update_trigger: The image update trigger that caused the + build. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageUpdateTrigger + :param git_commit_trigger: The git commit trigger that caused the build. + :type git_commit_trigger: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.GitCommitTrigger + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param platform: The platform properties against which the build will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param provisioning_state: The provisioning state of a build. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'build_type': {'key': 'properties.buildType', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, + 'output_images': {'key': 'properties.outputImages', 'type': '[ImageDescriptor]'}, + 'build_task': {'key': 'properties.buildTask', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'git_commit_trigger': {'key': 'properties.gitCommitTrigger', 'type': 'GitCommitTrigger'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, build_id: str=None, status=None, last_updated_time=None, build_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, build_task: str=None, image_update_trigger=None, git_commit_trigger=None, is_archive_enabled: bool=False, platform=None, provisioning_state=None, **kwargs) -> None: + super(Build, self).__init__(**kwargs) + self.build_id = build_id + self.status = status + self.last_updated_time = last_updated_time + self.build_type = build_type + self.create_time = create_time + self.start_time = start_time + self.finish_time = finish_time + self.output_images = output_images + self.build_task = build_task + self.image_update_trigger = image_update_trigger + self.git_commit_trigger = git_commit_trigger + self.is_archive_enabled = is_archive_enabled + self.platform = platform + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py new file mode 100644 index 000000000000..9b7de27a5c4d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class BuildStep(ProxyResource): + """Build step resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: The properties of a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BuildStepProperties'}, + } + + def __init__(self, **kwargs): + super(BuildStep, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py new file mode 100644 index 000000000000..53dcc65ab031 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BuildStepPaged(Paged): + """ + A paging container for iterating over a list of :class:`BuildStep ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BuildStep]'} + } + + def __init__(self, *args, **kwargs): + + super(BuildStepPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py new file mode 100644 index 000000000000..572ba0fdd2c2 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepProperties(Model): + """Base properties for any build step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the build step. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep'} + } + + def __init__(self, **kwargs): + super(BuildStepProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py new file mode 100644 index 000000000000..21eff6be65aa --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepProperties(Model): + """Base properties for any build step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the build step. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep'} + } + + def __init__(self, **kwargs) -> None: + super(BuildStepProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py new file mode 100644 index 000000000000..f4b428b026a9 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepPropertiesUpdateParameters(Model): + """The properties for updating a build step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters'} + } + + def __init__(self, **kwargs): + super(BuildStepPropertiesUpdateParameters, self).__init__(**kwargs) + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py new file mode 100644 index 000000000000..14e8daba8bcc --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepPropertiesUpdateParameters(Model): + """The properties for updating a build step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters'} + } + + def __init__(self, **kwargs) -> None: + super(BuildStepPropertiesUpdateParameters, self).__init__(**kwargs) + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py new file mode 100644 index 000000000000..de3af6351f11 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class BuildStep(ProxyResource): + """Build step resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: The properties of a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BuildStepProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(BuildStep, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py new file mode 100644 index 000000000000..4d80e115cb18 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepUpdateParameters(Model): + """The parameters for updating a build step. + + :param properties: The properties for updating a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepPropertiesUpdateParameters + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'BuildStepPropertiesUpdateParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(BuildStepUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py new file mode 100644 index 000000000000..7f5a0a3b1dd9 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildStepUpdateParameters(Model): + """The parameters for updating a build step. + + :param properties: The properties for updating a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepPropertiesUpdateParameters + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'BuildStepPropertiesUpdateParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties=None, tags=None, **kwargs) -> None: + super(BuildStepUpdateParameters, self).__init__(**kwargs) + self.properties = properties + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py new file mode 100644 index 000000000000..5f34df9d50ab --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BuildTask(Resource): + """The build task that has the resource properties and all build items. The + build task will have all information to schedule a build against it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the build task. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar creation_date: The creation date of build task. + :vartype creation_date: datetime + :param alias: Required. The alternative updatable name for a build task. + :type alias: str + :param status: The current status of build task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskStatus + :param source_repository: Required. The properties that describes the + source(code) for the build task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceRepositoryProperties + :param platform: Required. The platform properties against which the build + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param timeout: Build timeout in seconds. Default value: 3600 . + :type timeout: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'alias': {'required': True}, + 'source_repository': {'required': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'source_repository': {'key': 'properties.sourceRepository', 'type': 'SourceRepositoryProperties'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(BuildTask, self).__init__(**kwargs) + self.provisioning_state = None + self.creation_date = None + self.alias = kwargs.get('alias', None) + self.status = kwargs.get('status', None) + self.source_repository = kwargs.get('source_repository', None) + self.platform = kwargs.get('platform', None) + self.timeout = kwargs.get('timeout', 3600) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py new file mode 100644 index 000000000000..fddeb6dd4183 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .queue_build_request import QueueBuildRequest + + +class BuildTaskBuildRequest(QueueBuildRequest): + """The queue build parameters based on a build task. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param build_task_name: Required. The name of build task against which + build has to be queued. + :type build_task_name: str + """ + + _validation = { + 'type': {'required': True}, + 'build_task_name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'build_task_name': {'key': 'buildTaskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BuildTaskBuildRequest, self).__init__(**kwargs) + self.build_task_name = kwargs.get('build_task_name', None) + self.type = 'BuildTask' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py new file mode 100644 index 000000000000..a22d16561ea7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .queue_build_request import QueueBuildRequest + + +class BuildTaskBuildRequest(QueueBuildRequest): + """The queue build parameters based on a build task. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param build_task_name: Required. The name of build task against which + build has to be queued. + :type build_task_name: str + """ + + _validation = { + 'type': {'required': True}, + 'build_task_name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'build_task_name': {'key': 'buildTaskName', 'type': 'str'}, + } + + def __init__(self, *, build_task_name: str, **kwargs) -> None: + super(BuildTaskBuildRequest, self).__init__(**kwargs) + self.build_task_name = build_task_name + self.type = 'BuildTask' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py new file mode 100644 index 000000000000..c56e26992731 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildTaskFilter(Model): + """The filter that can be used for listing build tasks. + + :param alias: The alternative name for build task. + :type alias: str + """ + + _attribute_map = { + 'alias': {'key': 'alias', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BuildTaskFilter, self).__init__(**kwargs) + self.alias = kwargs.get('alias', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py new file mode 100644 index 000000000000..12e95e2f1fcc --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildTaskFilter(Model): + """The filter that can be used for listing build tasks. + + :param alias: The alternative name for build task. + :type alias: str + """ + + _attribute_map = { + 'alias': {'key': 'alias', 'type': 'str'}, + } + + def __init__(self, *, alias: str=None, **kwargs) -> None: + super(BuildTaskFilter, self).__init__(**kwargs) + self.alias = alias diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py new file mode 100644 index 000000000000..87efd3543a2a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BuildTaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`BuildTask ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BuildTask]'} + } + + def __init__(self, *args, **kwargs): + + super(BuildTaskPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py new file mode 100644 index 000000000000..301f704f985d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BuildTask(Resource): + """The build task that has the resource properties and all build items. The + build task will have all information to schedule a build against it. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the build task. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar creation_date: The creation date of build task. + :vartype creation_date: datetime + :param alias: Required. The alternative updatable name for a build task. + :type alias: str + :param status: The current status of build task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskStatus + :param source_repository: Required. The properties that describes the + source(code) for the build task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceRepositoryProperties + :param platform: Required. The platform properties against which the build + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param timeout: Build timeout in seconds. Default value: 3600 . + :type timeout: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'alias': {'required': True}, + 'source_repository': {'required': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'source_repository': {'key': 'properties.sourceRepository', 'type': 'SourceRepositoryProperties'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + } + + def __init__(self, *, location: str, alias: str, source_repository, platform, tags=None, status=None, timeout: int=3600, **kwargs) -> None: + super(BuildTask, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.creation_date = None + self.alias = alias + self.status = status + self.source_repository = source_repository + self.platform = platform + self.timeout = timeout diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py new file mode 100644 index 000000000000..2a83d2fdb470 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildTaskUpdateParameters(Model): + """The parameters for updating a build task. + + :param alias: The alternative updatable name for a build task. + :type alias: str + :param status: The current status of build task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskStatus + :param platform: The platform properties against which the build has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param timeout: Build timeout in seconds. + :type timeout: int + :param source_repository: The properties that describes the source(code) + for the build task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceRepositoryUpdateParameters + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'timeout': {'maximum': 28800, 'minimum': 300}, + } + + _attribute_map = { + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'source_repository': {'key': 'properties.sourceRepository', 'type': 'SourceRepositoryUpdateParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(BuildTaskUpdateParameters, self).__init__(**kwargs) + self.alias = kwargs.get('alias', None) + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.timeout = kwargs.get('timeout', None) + self.source_repository = kwargs.get('source_repository', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py new file mode 100644 index 000000000000..ce8d18802d37 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildTaskUpdateParameters(Model): + """The parameters for updating a build task. + + :param alias: The alternative updatable name for a build task. + :type alias: str + :param status: The current status of build task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskStatus + :param platform: The platform properties against which the build has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param timeout: Build timeout in seconds. + :type timeout: int + :param source_repository: The properties that describes the source(code) + for the build task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceRepositoryUpdateParameters + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'timeout': {'maximum': 28800, 'minimum': 300}, + } + + _attribute_map = { + 'alias': {'key': 'properties.alias', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'source_repository': {'key': 'properties.sourceRepository', 'type': 'SourceRepositoryUpdateParameters'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, alias: str=None, status=None, platform=None, timeout: int=None, source_repository=None, tags=None, **kwargs) -> None: + super(BuildTaskUpdateParameters, self).__init__(**kwargs) + self.alias = alias + self.status = status + self.platform = platform + self.timeout = timeout + self.source_repository = source_repository + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py new file mode 100644 index 000000000000..35059b848b98 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildUpdateParameters(Model): + """The set of build properties that can be updated. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + """ + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BuildUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py new file mode 100644 index 000000000000..cedec7cf0dd1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BuildUpdateParameters(Model): + """The set of build properties that can be updated. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + """ + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + } + + def __init__(self, *, is_archive_enabled: bool=None, **kwargs) -> None: + super(BuildUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py new file mode 100644 index 000000000000..8ad43a9f785a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CallbackConfig(Model): + """The configuration of service URI and custom headers for the webhook. + + All required parameters must be populated in order to send to Azure. + + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + """ + + _validation = { + 'service_uri': {'required': True}, + } + + _attribute_map = { + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'customHeaders', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CallbackConfig, self).__init__(**kwargs) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py new file mode 100644 index 000000000000..27ffc7825431 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CallbackConfig(Model): + """The configuration of service URI and custom headers for the webhook. + + All required parameters must be populated in order to send to Azure. + + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + """ + + _validation = { + 'service_uri': {'required': True}, + } + + _attribute_map = { + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'customHeaders', 'type': '{str}'}, + } + + def __init__(self, *, service_uri: str, custom_headers=None, **kwargs) -> None: + super(CallbackConfig, self).__init__(**kwargs) + self.service_uri = service_uri + self.custom_headers = custom_headers diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py new file mode 100644 index 000000000000..9ea40f3ac024 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class SkuName(str, Enum): + + classic = "Classic" + basic = "Basic" + standard = "Standard" + premium = "Premium" + + +class SkuTier(str, Enum): + + classic = "Classic" + basic = "Basic" + standard = "Standard" + premium = "Premium" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + + +class PasswordName(str, Enum): + + password = "password" + password2 = "password2" + + +class RegistryUsageUnit(str, Enum): + + count = "Count" + bytes = "Bytes" + + +class WebhookStatus(str, Enum): + + enabled = "enabled" + disabled = "disabled" + + +class WebhookAction(str, Enum): + + push = "push" + delete = "delete" + + +class BuildStatus(str, Enum): + + queued = "Queued" + started = "Started" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + error = "Error" + timeout = "Timeout" + + +class BuildType(str, Enum): + + auto_build = "AutoBuild" + quick_build = "QuickBuild" + + +class OsType(str, Enum): + + windows = "Windows" + linux = "Linux" + + +class BuildTaskStatus(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class SourceControlType(str, Enum): + + github = "Github" + visual_studio_team_service = "VisualStudioTeamService" + + +class TokenType(str, Enum): + + pat = "PAT" + oauth = "OAuth" + + +class BaseImageDependencyType(str, Enum): + + build_time = "BuildTime" + run_time = "RunTime" + + +class BaseImageTriggerType(str, Enum): + + all = "All" + runtime = "Runtime" + none = "None" diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py new file mode 100644 index 000000000000..ee7eb09062aa --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .build_step_properties import BuildStepProperties + + +class DockerBuildStep(BuildStepProperties): + """The Docker build step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the build step. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param branch: The repository branch name. + :type branch: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. Default value: True . + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. Default value: False . + :type no_cache: bool + :param docker_file_path: The Docker file path relative to the source + control root. + :type docker_file_path: str + :param context_path: The relative context path for a docker build in the + source. + :type context_path: str + :param build_arguments: The custom arguments for building this build step. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :ivar base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageDependency] + :param base_image_trigger: The type of the auto trigger for base image + dependency updates. Possible values include: 'All', 'Runtime', 'None' + :type base_image_trigger: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageTriggerType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'base_image_dependencies': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStep, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.image_names = kwargs.get('image_names', None) + self.is_push_enabled = kwargs.get('is_push_enabled', True) + self.no_cache = kwargs.get('no_cache', False) + self.docker_file_path = kwargs.get('docker_file_path', None) + self.context_path = kwargs.get('context_path', None) + self.build_arguments = kwargs.get('build_arguments', None) + self.base_image_dependencies = None + self.base_image_trigger = kwargs.get('base_image_trigger', None) + self.type = 'Docker' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py new file mode 100644 index 000000000000..eb21648af215 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .build_step_properties import BuildStepProperties + + +class DockerBuildStep(BuildStepProperties): + """The Docker build step. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the build step. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param branch: The repository branch name. + :type branch: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. Default value: True . + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. Default value: False . + :type no_cache: bool + :param docker_file_path: The Docker file path relative to the source + control root. + :type docker_file_path: str + :param context_path: The relative context path for a docker build in the + source. + :type context_path: str + :param build_arguments: The custom arguments for building this build step. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :ivar base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageDependency] + :param base_image_trigger: The type of the auto trigger for base image + dependency updates. Possible values include: 'All', 'Runtime', 'None' + :type base_image_trigger: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageTriggerType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'base_image_dependencies': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'str'}, + } + + def __init__(self, *, branch: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, docker_file_path: str=None, context_path: str=None, build_arguments=None, base_image_trigger=None, **kwargs) -> None: + super(DockerBuildStep, self).__init__(**kwargs) + self.branch = branch + self.image_names = image_names + self.is_push_enabled = is_push_enabled + self.no_cache = no_cache + self.docker_file_path = docker_file_path + self.context_path = context_path + self.build_arguments = build_arguments + self.base_image_dependencies = None + self.base_image_trigger = base_image_trigger + self.type = 'Docker' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py new file mode 100644 index 000000000000..5a3a9893490d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .build_step_properties_update_parameters import BuildStepPropertiesUpdateParameters + + +class DockerBuildStepUpdateParameters(BuildStepPropertiesUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param branch: The repository branch name. + :type branch: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. + :type no_cache: bool + :param docker_file_path: The Docker file path relative to the source + control root. + :type docker_file_path: str + :param context_path: The relative context path for a docker build in the + source. + :type context_path: str + :param build_arguments: The custom arguments for building this build step. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :param base_image_trigger: The type of the auto trigger for base image + dependency updates. Possible values include: 'All', 'Runtime', 'None' + :type base_image_trigger: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageTriggerType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.image_names = kwargs.get('image_names', None) + self.is_push_enabled = kwargs.get('is_push_enabled', None) + self.no_cache = kwargs.get('no_cache', None) + self.docker_file_path = kwargs.get('docker_file_path', None) + self.context_path = kwargs.get('context_path', None) + self.build_arguments = kwargs.get('build_arguments', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + self.type = 'Docker' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py new file mode 100644 index 000000000000..6a300c65d6cf --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .build_step_properties_update_parameters import BuildStepPropertiesUpdateParameters + + +class DockerBuildStepUpdateParameters(BuildStepPropertiesUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param branch: The repository branch name. + :type branch: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. + :type no_cache: bool + :param docker_file_path: The Docker file path relative to the source + control root. + :type docker_file_path: str + :param context_path: The relative context path for a docker build in the + source. + :type context_path: str + :param build_arguments: The custom arguments for building this build step. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :param base_image_trigger: The type of the auto trigger for base image + dependency updates. Possible values include: 'All', 'Runtime', 'None' + :type base_image_trigger: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BaseImageTriggerType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'str'}, + } + + def __init__(self, *, branch: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, context_path: str=None, build_arguments=None, base_image_trigger=None, **kwargs) -> None: + super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) + self.branch = branch + self.image_names = image_names + self.is_push_enabled = is_push_enabled + self.no_cache = no_cache + self.docker_file_path = docker_file_path + self.context_path = context_path + self.build_arguments = build_arguments + self.base_image_trigger = base_image_trigger + self.type = 'Docker' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py new file mode 100644 index 000000000000..f81722f45561 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_info import EventInfo + + +class Event(EventInfo): + """The event for a webhook. + + :param id: The event ID. + :type id: str + :param event_request_message: The event request message sent to the + service URI. + :type event_request_message: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventResponseMessage + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'event_request_message': {'key': 'eventRequestMessage', 'type': 'EventRequestMessage'}, + 'event_response_message': {'key': 'eventResponseMessage', 'type': 'EventResponseMessage'}, + } + + def __init__(self, **kwargs): + super(Event, self).__init__(**kwargs) + self.event_request_message = kwargs.get('event_request_message', None) + self.event_response_message = kwargs.get('event_response_message', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py new file mode 100644 index 000000000000..24e45dd7de4e --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventContent(Model): + """The content of the event request message. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Target + :param request: The request that generated the event. + :type request: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Request + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Actor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Source + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'Target'}, + 'request': {'key': 'request', 'type': 'Request'}, + 'actor': {'key': 'actor', 'type': 'Actor'}, + 'source': {'key': 'source', 'type': 'Source'}, + } + + def __init__(self, **kwargs): + super(EventContent, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.timestamp = kwargs.get('timestamp', None) + self.action = kwargs.get('action', None) + self.target = kwargs.get('target', None) + self.request = kwargs.get('request', None) + self.actor = kwargs.get('actor', None) + self.source = kwargs.get('source', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py new file mode 100644 index 000000000000..6e1e88a9fec1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventContent(Model): + """The content of the event request message. + + :param id: The event ID. + :type id: str + :param timestamp: The time at which the event occurred. + :type timestamp: datetime + :param action: The action that encompasses the provided event. + :type action: str + :param target: The target of the event. + :type target: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Target + :param request: The request that generated the event. + :type request: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Request + :param actor: The agent that initiated the event. For most situations, + this could be from the authorization context of the request. + :type actor: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Actor + :param source: The registry node that generated the event. Put + differently, while the actor initiates the event, the source generates it. + :type source: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Source + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'action': {'key': 'action', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'Target'}, + 'request': {'key': 'request', 'type': 'Request'}, + 'actor': {'key': 'actor', 'type': 'Actor'}, + 'source': {'key': 'source', 'type': 'Source'}, + } + + def __init__(self, *, id: str=None, timestamp=None, action: str=None, target=None, request=None, actor=None, source=None, **kwargs) -> None: + super(EventContent, self).__init__(**kwargs) + self.id = id + self.timestamp = timestamp + self.action = action + self.target = target + self.request = request + self.actor = actor + self.source = source diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py new file mode 100644 index 000000000000..7199044b2e39 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventInfo(Model): + """The basic information of an event. + + :param id: The event ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py new file mode 100644 index 000000000000..192990067407 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventInfo(Model): + """The basic information of an event. + + :param id: The event ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EventInfo, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py new file mode 100644 index 000000000000..65f7267e50c9 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EventPaged(Paged): + """ + A paging container for iterating over a list of :class:`Event ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Event]'} + } + + def __init__(self, *args, **kwargs): + + super(EventPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py new file mode 100644 index 000000000000..2c09cd73fd97 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .event_info import EventInfo + + +class Event(EventInfo): + """The event for a webhook. + + :param id: The event ID. + :type id: str + :param event_request_message: The event request message sent to the + service URI. + :type event_request_message: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventResponseMessage + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'event_request_message': {'key': 'eventRequestMessage', 'type': 'EventRequestMessage'}, + 'event_response_message': {'key': 'eventResponseMessage', 'type': 'EventResponseMessage'}, + } + + def __init__(self, *, id: str=None, event_request_message=None, event_response_message=None, **kwargs) -> None: + super(Event, self).__init__(id=id, **kwargs) + self.event_request_message = event_request_message + self.event_response_message = event_response_message diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py new file mode 100644 index 000000000000..e23c5cd5adec --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventRequestMessage(Model): + """The event request message sent to the service URI. + + :param content: The content of the event request message. + :type content: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventContent + :param headers: The headers of the event request message. + :type headers: dict[str, str] + :param method: The HTTP method used to send the event request message. + :type method: str + :param request_uri: The URI used to send the event request message. + :type request_uri: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'EventContent'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'method': {'key': 'method', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventRequestMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.headers = kwargs.get('headers', None) + self.method = kwargs.get('method', None) + self.request_uri = kwargs.get('request_uri', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py new file mode 100644 index 000000000000..fd34ee3a8af6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventRequestMessage(Model): + """The event request message sent to the service URI. + + :param content: The content of the event request message. + :type content: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventContent + :param headers: The headers of the event request message. + :type headers: dict[str, str] + :param method: The HTTP method used to send the event request message. + :type method: str + :param request_uri: The URI used to send the event request message. + :type request_uri: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'EventContent'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'method': {'key': 'method', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, content=None, headers=None, method: str=None, request_uri: str=None, version: str=None, **kwargs) -> None: + super(EventRequestMessage, self).__init__(**kwargs) + self.content = content + self.headers = headers + self.method = method + self.request_uri = request_uri + self.version = version diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py new file mode 100644 index 000000000000..ffb8feb12a1e --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventResponseMessage(Model): + """The event response message received from the service URI. + + :param content: The content of the event response message. + :type content: str + :param headers: The headers of the event response message. + :type headers: dict[str, str] + :param reason_phrase: The reason phrase of the event response message. + :type reason_phrase: str + :param status_code: The status code of the event response message. + :type status_code: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventResponseMessage, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.headers = kwargs.get('headers', None) + self.reason_phrase = kwargs.get('reason_phrase', None) + self.status_code = kwargs.get('status_code', None) + self.version = kwargs.get('version', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py new file mode 100644 index 000000000000..4b1351377b4b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EventResponseMessage(Model): + """The event response message received from the service URI. + + :param content: The content of the event response message. + :type content: str + :param headers: The headers of the event response message. + :type headers: dict[str, str] + :param reason_phrase: The reason phrase of the event response message. + :type reason_phrase: str + :param status_code: The status code of the event response message. + :type status_code: str + :param version: The HTTP message version. + :type version: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{str}'}, + 'reason_phrase': {'key': 'reasonPhrase', 'type': 'str'}, + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, content: str=None, headers=None, reason_phrase: str=None, status_code: str=None, version: str=None, **kwargs) -> None: + super(EventResponseMessage, self).__init__(**kwargs) + self.content = content + self.headers = headers + self.reason_phrase = reason_phrase + self.status_code = status_code + self.version = version diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py new file mode 100644 index 000000000000..fe843cf056c0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GitCommitTrigger(Model): + """The git commit trigger that caused a build. + + :param id: The unique ID of the trigger. + :type id: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param repository_url: The repository URL. + :type repository_url: str + :param branch_name: The branch name in the repository. + :type branch_name: str + :param provider_type: The source control provider type. + :type provider_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GitCommitTrigger, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.commit_id = kwargs.get('commit_id', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch_name = kwargs.get('branch_name', None) + self.provider_type = kwargs.get('provider_type', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py new file mode 100644 index 000000000000..ba5464bfe7cd --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GitCommitTrigger(Model): + """The git commit trigger that caused a build. + + :param id: The unique ID of the trigger. + :type id: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param repository_url: The repository URL. + :type repository_url: str + :param branch_name: The branch name in the repository. + :type branch_name: str + :param provider_type: The source control provider type. + :type provider_type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch_name': {'key': 'branchName', 'type': 'str'}, + 'provider_type': {'key': 'providerType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, commit_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: + super(GitCommitTrigger, self).__init__(**kwargs) + self.id = id + self.commit_id = commit_id + self.repository_url = repository_url + self.branch_name = branch_name + self.provider_type = provider_type diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py new file mode 100644 index 000000000000..1cfd03ed778c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImageDescriptor(Model): + """Properties for a registry image. + + :param registry: The registry login server. + :type registry: str + :param repository: The repository name. + :type repository: str + :param tag: The tag name. + :type tag: str + :param digest: The sha256-based digest of the image manifest. + :type digest: str + """ + + _attribute_map = { + 'registry': {'key': 'registry', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageDescriptor, self).__init__(**kwargs) + self.registry = kwargs.get('registry', None) + self.repository = kwargs.get('repository', None) + self.tag = kwargs.get('tag', None) + self.digest = kwargs.get('digest', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py new file mode 100644 index 000000000000..72928cf47326 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImageDescriptor(Model): + """Properties for a registry image. + + :param registry: The registry login server. + :type registry: str + :param repository: The repository name. + :type repository: str + :param tag: The tag name. + :type tag: str + :param digest: The sha256-based digest of the image manifest. + :type digest: str + """ + + _attribute_map = { + 'registry': {'key': 'registry', 'type': 'str'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'str'}, + } + + def __init__(self, *, registry: str=None, repository: str=None, tag: str=None, digest: str=None, **kwargs) -> None: + super(ImageDescriptor, self).__init__(**kwargs) + self.registry = registry + self.repository = repository + self.tag = tag + self.digest = digest diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py new file mode 100644 index 000000000000..c1d25cd991f0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImageUpdateTrigger(Model): + """The image update trigger that caused a build. + + :param id: The unique ID of the trigger. + :type id: str + :param timestamp: The timestamp when the image update happened. + :type timestamp: datetime + :param images: The list of image updates that caused the build. + :type images: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageDescriptor] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'images': {'key': 'images', 'type': '[ImageDescriptor]'}, + } + + def __init__(self, **kwargs): + super(ImageUpdateTrigger, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.timestamp = kwargs.get('timestamp', None) + self.images = kwargs.get('images', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py new file mode 100644 index 000000000000..75e352ba51f6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ImageUpdateTrigger(Model): + """The image update trigger that caused a build. + + :param id: The unique ID of the trigger. + :type id: str + :param timestamp: The timestamp when the image update happened. + :type timestamp: datetime + :param images: The list of image updates that caused the build. + :type images: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImageDescriptor] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'images': {'key': 'images', 'type': '[ImageDescriptor]'}, + } + + def __init__(self, *, id: str=None, timestamp=None, images=None, **kwargs) -> None: + super(ImageUpdateTrigger, self).__init__(**kwargs) + self.id = id + self.timestamp = timestamp + self.images = images diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py new file mode 100644 index 000000000000..cda8d8152245 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the container registry + operation. + :type display: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDisplayDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py new file mode 100644 index 000000000000..105ec960f4da --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py new file mode 100644 index 000000000000..afab8bcf4c0d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The display information for the container registry + operation. + :type display: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDisplayDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py new file mode 100644 index 000000000000..6cb8463b21fc --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayDefinition(Model): + """The display information for a container registry operation. + + :param provider: The resource provider name: Microsoft.ContainerRegistry. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py new file mode 100644 index 000000000000..98abb699335c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplayDefinition(Model): + """The display information for a container registry operation. + + :param provider: The resource provider name: Microsoft.ContainerRegistry. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplayDefinition, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py new file mode 100644 index 000000000000..1d2116661c53 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlatformProperties(Model): + """The platform properties against which the build has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The operating system type required for the + build. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OsType + :param cpu: The CPU configuration in terms of number of cores required for + the build. + :type cpu: int + """ + + _validation = { + 'os_type': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(PlatformProperties, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.cpu = kwargs.get('cpu', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py new file mode 100644 index 000000000000..a136a050b3f9 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PlatformProperties(Model): + """The platform properties against which the build has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The operating system type required for the + build. Possible values include: 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OsType + :param cpu: The CPU configuration in terms of number of cores required for + the build. + :type cpu: int + """ + + _validation = { + 'os_type': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'osType', 'type': 'str'}, + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, *, os_type, cpu: int=None, **kwargs) -> None: + super(PlatformProperties, self).__init__(**kwargs) + self.os_type = os_type + self.cpu = cpu diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py new file mode 100644 index 000000000000..5c52aad9de10 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProxyResource(Model): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py new file mode 100644 index 000000000000..d310c7cbf9b1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProxyResource(Model): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py new file mode 100644 index 000000000000..8ba452234c6c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueueBuildRequest(Model): + """The queue build request parameters. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BuildTaskBuildRequest, QuickBuildRequest + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'BuildTask': 'BuildTaskBuildRequest', 'QuickBuild': 'QuickBuildRequest'} + } + + def __init__(self, **kwargs): + super(QueueBuildRequest, self).__init__(**kwargs) + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py new file mode 100644 index 000000000000..eeeec1215e9b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueueBuildRequest(Model): + """The queue build request parameters. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BuildTaskBuildRequest, QuickBuildRequest + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'BuildTask': 'BuildTaskBuildRequest', 'QuickBuild': 'QuickBuildRequest'} + } + + def __init__(self, **kwargs) -> None: + super(QueueBuildRequest, self).__init__(**kwargs) + self.type = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py new file mode 100644 index 000000000000..7e5351137e90 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .queue_build_request import QueueBuildRequest + + +class QuickBuildRequest(QueueBuildRequest): + """The queue build request parameters for a quick build. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param source_location: Required. The URL(absolute or relative) of the + source that needs to be built. For Docker build, it can be an URL to a tar + or github repoistory as supported by Docker. + If it is relative URL, the relative path should be obtained from calling + getSourceUploadUrl API. + :type source_location: str + :param build_arguments: The collection of build arguments to be used. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. Default value: True . + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. Default value: False . + :type no_cache: bool + :param timeout: Build timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the build + will happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param docker_file_path: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + """ + + _validation = { + 'type': {'required': True}, + 'source_location': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuickBuildRequest, self).__init__(**kwargs) + self.image_names = kwargs.get('image_names', None) + self.source_location = kwargs.get('source_location', None) + self.build_arguments = kwargs.get('build_arguments', None) + self.is_push_enabled = kwargs.get('is_push_enabled', True) + self.no_cache = kwargs.get('no_cache', False) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.docker_file_path = kwargs.get('docker_file_path', None) + self.type = 'QuickBuild' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py new file mode 100644 index 000000000000..9678b6d80a05 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .queue_build_request import QueueBuildRequest + + +class QuickBuildRequest(QueueBuildRequest): + """The queue build request parameters for a quick build. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Constant filled by server. + :type type: str + :param image_names: The fully qualified image names including the + repository and tag. + :type image_names: list[str] + :param source_location: Required. The URL(absolute or relative) of the + source that needs to be built. For Docker build, it can be an URL to a tar + or github repoistory as supported by Docker. + If it is relative URL, the relative path should be obtained from calling + getSourceUploadUrl API. + :type source_location: str + :param build_arguments: The collection of build arguments to be used. + :type build_arguments: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :param is_push_enabled: The value of this property indicates whether the + image built should be pushed to the registry or not. Default value: True . + :type is_push_enabled: bool + :param no_cache: The value of this property indicates whether the image + cache is enabled or not. Default value: False . + :type no_cache: bool + :param timeout: Build timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the build + will happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PlatformProperties + :param docker_file_path: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + """ + + _validation = { + 'type': {'required': True}, + 'source_location': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'image_names': {'key': 'imageNames', 'type': '[str]'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'build_arguments': {'key': 'buildArguments', 'type': '[BuildArgument]'}, + 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, + 'no_cache': {'key': 'noCache', 'type': 'bool'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'docker_file_path': {'key': 'dockerFilePath', 'type': 'str'}, + } + + def __init__(self, *, source_location: str, platform, docker_file_path: str, image_names=None, build_arguments=None, is_push_enabled: bool=True, no_cache: bool=False, timeout: int=3600, **kwargs) -> None: + super(QuickBuildRequest, self).__init__(**kwargs) + self.image_names = image_names + self.source_location = source_location + self.build_arguments = build_arguments + self.is_push_enabled = is_push_enabled + self.no_cache = no_cache + self.timeout = timeout + self.platform = platform + self.docker_file_path = docker_file_path + self.type = 'QuickBuild' diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py new file mode 100644 index 000000000000..1a4514f5f72c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateCredentialParameters(Model): + """The parameters used to regenerate the login credential. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PasswordName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + } + + def __init__(self, **kwargs): + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py new file mode 100644 index 000000000000..4300b5dfddc1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegenerateCredentialParameters(Model): + """The parameters used to regenerate the login credential. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Specifies name of the password which should be + regenerated -- password or password2. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PasswordName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py new file mode 100644 index 000000000000..239c1c7d9a2b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Registry(Resource): + """An object that represents a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param sku: Required. The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Sku + :ivar login_server: The URL that can be used to log into the container + registry. + :vartype login_server: str + :ivar creation_date: The creation date of the container registry in + ISO8601 format. + :vartype creation_date: datetime + :ivar provisioning_state: The provisioning state of the container registry + at the time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Status + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. Default value: False . + :type admin_user_enabled: bool + :param storage_account: The properties of the storage account for the + container registry. Only applicable to Classic SKU. + :type storage_account: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.StorageAccountProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'login_server': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'login_server': {'key': 'properties.loginServer', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, **kwargs): + super(Registry, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.login_server = None + self.creation_date = None + self.provisioning_state = None + self.status = None + self.admin_user_enabled = kwargs.get('admin_user_enabled', False) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py new file mode 100644 index 000000000000..35f58a636786 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryListCredentialsResult(Model): + """The response from the ListCredentials operation. + + :param username: The username for a container registry. + :type username: str + :param passwords: The list of passwords for a container registry. + :type passwords: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, + } + + def __init__(self, **kwargs): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py new file mode 100644 index 000000000000..95d4581cc130 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryListCredentialsResult(Model): + """The response from the ListCredentials operation. + + :param username: The username for a container registry. + :type username: str + :param passwords: The list of passwords for a container registry. + :type passwords: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'}, + } + + def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None: + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = username + self.passwords = passwords diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py new file mode 100644 index 000000000000..9d4a575eac04 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameCheckRequest(Model): + """A request to check whether a container registry name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. + :type name: str + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.ContainerRegistry/registries" + + def __init__(self, **kwargs): + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py new file mode 100644 index 000000000000..67f5ff9be671 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameCheckRequest(Model): + """A request to check whether a container registry name is available. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the container registry. + :type name: str + :ivar type: Required. The resource type of the container registry. This + field must be set to 'Microsoft.ContainerRegistry/registries'. Default + value: "Microsoft.ContainerRegistry/registries" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.ContainerRegistry/registries" + + def __init__(self, *, name: str, **kwargs) -> None: + super(RegistryNameCheckRequest, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py new file mode 100644 index 000000000000..94345ba6d549 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameStatus(Model): + """The result of a request to check the availability of a container registry + name. + + :param name_available: The value that indicates whether the name is + available. + :type name_available: bool + :param reason: If any, the reason that the name is not available. + :type reason: str + :param message: If any, the error message that provides more detail for + the reason that the name is not available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py new file mode 100644 index 000000000000..8b7b264c2d0d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryNameStatus(Model): + """The result of a request to check the availability of a container registry + name. + + :param name_available: The value that indicates whether the name is + available. + :type name_available: bool + :param reason: If any, the reason that the name is not available. + :type reason: str + :param message: If any, the error message that provides more detail for + the reason that the name is not available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(RegistryNameStatus, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py new file mode 100644 index 000000000000..324b6f52e6cc --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RegistryPaged(Paged): + """ + A paging container for iterating over a list of :class:`Registry ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Registry]'} + } + + def __init__(self, *args, **kwargs): + + super(RegistryPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py new file mode 100644 index 000000000000..f2984ae1d516 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryPassword(Model): + """The login password for the container registry. + + :param name: The password name. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PasswordName + :param value: The password value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py new file mode 100644 index 000000000000..97b40f8760c6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryPassword(Model): + """The login password for the container registry. + + :param name: The password name. Possible values include: 'password', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PasswordName + :param value: The password value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'PasswordName'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name=None, value: str=None, **kwargs) -> None: + super(RegistryPassword, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py new file mode 100644 index 000000000000..4f7ac193cac8 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Registry(Resource): + """An object that represents a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param sku: Required. The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Sku + :ivar login_server: The URL that can be used to log into the container + registry. + :vartype login_server: str + :ivar creation_date: The creation date of the container registry in + ISO8601 format. + :vartype creation_date: datetime + :ivar provisioning_state: The provisioning state of the container registry + at the time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Status + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. Default value: False . + :type admin_user_enabled: bool + :param storage_account: The properties of the storage account for the + container registry. Only applicable to Classic SKU. + :type storage_account: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.StorageAccountProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'login_server': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'login_server': {'key': 'properties.loginServer', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None: + super(Registry, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.login_server = None + self.creation_date = None + self.provisioning_state = None + self.status = None + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py new file mode 100644 index 000000000000..c71ae281d078 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUpdateParameters(Model): + """The parameters for updating a container registry. + + :param tags: The tags for the container registry. + :type tags: dict[str, str] + :param sku: The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param storage_account: The parameters of a storage account for the + container registry. Only applicable to Classic SKU. If specified, the + storage account must be in the same physical location as the container + registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.StorageAccountProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, **kwargs): + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.admin_user_enabled = kwargs.get('admin_user_enabled', None) + self.storage_account = kwargs.get('storage_account', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py new file mode 100644 index 000000000000..e61030896b9c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUpdateParameters(Model): + """The parameters for updating a container registry. + + :param tags: The tags for the container registry. + :type tags: dict[str, str] + :param sku: The SKU of the container registry. + :type sku: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param storage_account: The parameters of a storage account for the + container registry. Only applicable to Classic SKU. If specified, the + storage account must be in the same physical location as the container + registry. + :type storage_account: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.StorageAccountProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None: + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.admin_user_enabled = admin_user_enabled + self.storage_account = storage_account diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py new file mode 100644 index 000000000000..b451aeff7c1a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsage(Model): + """The quota usage for a container registry. + + :param name: The name of the usage. + :type name: str + :param limit: The limit of the usage. + :type limit: long + :param current_value: The current value of the usage. + :type current_value: long + :param unit: The unit of measurement. Possible values include: 'Count', + 'Bytes' + :type unit: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUsageUnit + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistryUsage, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.limit = kwargs.get('limit', None) + self.current_value = kwargs.get('current_value', None) + self.unit = kwargs.get('unit', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py new file mode 100644 index 000000000000..9094762e888d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsageListResult(Model): + """The result of a request to get container registry quota usages. + + :param value: The list of container registry quota usages. + :type value: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py new file mode 100644 index 000000000000..79734e173989 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsageListResult(Model): + """The result of a request to get container registry quota usages. + + :param value: The list of container registry quota usages. + :type value: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py new file mode 100644 index 000000000000..c0e2684f6854 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RegistryUsage(Model): + """The quota usage for a container registry. + + :param name: The name of the usage. + :type name: str + :param limit: The limit of the usage. + :type limit: long + :param current_value: The current value of the usage. + :type current_value: long + :param unit: The unit of measurement. Possible values include: 'Count', + 'Bytes' + :type unit: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUsageUnit + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, limit: int=None, current_value: int=None, unit=None, **kwargs) -> None: + super(RegistryUsage, self).__init__(**kwargs) + self.name = name + self.limit = limit + self.current_value = current_value + self.unit = unit diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py new file mode 100644 index 000000000000..7f9a55f3ecc7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Replication(Resource): + """An object that represents a replication for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the replication at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + } + + def __init__(self, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py new file mode 100644 index 000000000000..f3fe32671075 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ReplicationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Replication ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Replication]'} + } + + def __init__(self, *args, **kwargs): + + super(ReplicationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py new file mode 100644 index 000000000000..d58d9fefecd1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Replication(Resource): + """An object that represents a replication for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state of the replication at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Replication, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.status = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py new file mode 100644 index 000000000000..003b15583a55 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ReplicationUpdateParameters(Model): + """The parameters for updating a replication. + + :param tags: The tags for the replication. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ReplicationUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py new file mode 100644 index 000000000000..5497bcdbc1f7 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ReplicationUpdateParameters(Model): + """The parameters for updating a replication. + + :param tags: The tags for the replication. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ReplicationUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py new file mode 100644 index 000000000000..e08090f53205 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Request(Model): + """The request that generated the event. + + :param id: The ID of the request that initiated the event. + :type id: str + :param addr: The IP or hostname and possibly port of the client connection + that initiated the event. This is the RemoteAddr from the standard http + request. + :type addr: str + :param host: The externally accessible hostname of the registry instance, + as specified by the http host header on incoming requests. + :type host: str + :param method: The request method that generated the event. + :type method: str + :param useragent: The user agent header of the request. + :type useragent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'addr': {'key': 'addr', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'useragent': {'key': 'useragent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Request, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.addr = kwargs.get('addr', None) + self.host = kwargs.get('host', None) + self.method = kwargs.get('method', None) + self.useragent = kwargs.get('useragent', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py new file mode 100644 index 000000000000..f42dae28c955 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Request(Model): + """The request that generated the event. + + :param id: The ID of the request that initiated the event. + :type id: str + :param addr: The IP or hostname and possibly port of the client connection + that initiated the event. This is the RemoteAddr from the standard http + request. + :type addr: str + :param host: The externally accessible hostname of the registry instance, + as specified by the http host header on incoming requests. + :type host: str + :param method: The request method that generated the event. + :type method: str + :param useragent: The user agent header of the request. + :type useragent: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'addr': {'key': 'addr', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'useragent': {'key': 'useragent', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, addr: str=None, host: str=None, method: str=None, useragent: str=None, **kwargs) -> None: + super(Request, self).__init__(**kwargs) + self.id = id + self.addr = addr + self.host = host + self.method = method + self.useragent = useragent diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py new file mode 100644 index 000000000000..3965a6f0cf40 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py new file mode 100644 index 000000000000..3a1d4bc4edd1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py new file mode 100644 index 000000000000..f7c63d82a39d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Possible values include: 'Classic', 'Basic', + 'Standard', 'Premium' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SkuName + :ivar tier: The SKU tier based on the SKU name. Possible values include: + 'Classic', 'Basic', 'Standard', 'Premium' + :vartype tier: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py new file mode 100644 index 000000000000..00da0bfdd6ed --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The SKU of a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name of the container registry. Required + for registry creation. Possible values include: 'Classic', 'Basic', + 'Standard', 'Premium' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SkuName + :ivar tier: The SKU tier based on the SKU name. Possible values include: + 'Classic', 'Basic', 'Standard', 'Premium' + :vartype tier: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py new file mode 100644 index 000000000000..132f4b2c1324 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Source(Model): + """The registry node that generated the event. Put differently, while the + actor initiates the event, the source generates it. + + :param addr: The IP or hostname and the port of the registry node that + generated the event. Generally, this will be resolved by os.Hostname() + along with the running port. + :type addr: str + :param instance_id: The running instance of an application. Changes after + each restart. + :type instance_id: str + """ + + _attribute_map = { + 'addr': {'key': 'addr', 'type': 'str'}, + 'instance_id': {'key': 'instanceID', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Source, self).__init__(**kwargs) + self.addr = kwargs.get('addr', None) + self.instance_id = kwargs.get('instance_id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py new file mode 100644 index 000000000000..1037c4944b05 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControlAuthInfo(Model): + """The authorization properties for accessing the source code repository. + + All required parameters must be populated in order to send to Azure. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TokenType + :param token: Required. The access token used to access the source control + provider. + :type token: str + :param refresh_token: The refresh token used to refresh the access token. + :type refresh_token: str + :param scope: The scope of the access token. + :type scope: str + :param expires_in: Time in seconds that the token remains valid + :type expires_in: int + """ + + _validation = { + 'token': {'required': True}, + } + + _attribute_map = { + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'token': {'key': 'token', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'expires_in': {'key': 'expiresIn', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(SourceControlAuthInfo, self).__init__(**kwargs) + self.token_type = kwargs.get('token_type', None) + self.token = kwargs.get('token', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.scope = kwargs.get('scope', None) + self.expires_in = kwargs.get('expires_in', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py new file mode 100644 index 000000000000..52c1894bbe8c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControlAuthInfo(Model): + """The authorization properties for accessing the source code repository. + + All required parameters must be populated in order to send to Azure. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TokenType + :param token: Required. The access token used to access the source control + provider. + :type token: str + :param refresh_token: The refresh token used to refresh the access token. + :type refresh_token: str + :param scope: The scope of the access token. + :type scope: str + :param expires_in: Time in seconds that the token remains valid + :type expires_in: int + """ + + _validation = { + 'token': {'required': True}, + } + + _attribute_map = { + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'token': {'key': 'token', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'expires_in': {'key': 'expiresIn', 'type': 'int'}, + } + + def __init__(self, *, token: str, token_type=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(SourceControlAuthInfo, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py new file mode 100644 index 000000000000..5aadcd407862 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Source(Model): + """The registry node that generated the event. Put differently, while the + actor initiates the event, the source generates it. + + :param addr: The IP or hostname and the port of the registry node that + generated the event. Generally, this will be resolved by os.Hostname() + along with the running port. + :type addr: str + :param instance_id: The running instance of an application. Changes after + each restart. + :type instance_id: str + """ + + _attribute_map = { + 'addr': {'key': 'addr', 'type': 'str'}, + 'instance_id': {'key': 'instanceID', 'type': 'str'}, + } + + def __init__(self, *, addr: str=None, instance_id: str=None, **kwargs) -> None: + super(Source, self).__init__(**kwargs) + self.addr = addr + self.instance_id = instance_id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py new file mode 100644 index 000000000000..f537dc82faaf --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceRepositoryProperties(Model): + """The properties of the source code repository. + + All required parameters must be populated in order to send to Azure. + + :param source_control_type: Required. The type of source control service. + Possible values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlType + :param repository_url: Required. The full URL to the source code + respository + :type repository_url: str + :param is_commit_trigger_enabled: The value of this property indicates + whether the source control commit trigger is enabled or not. Default + value: False . + :type is_commit_trigger_enabled: bool + :param source_control_auth_properties: The authorization properties for + accessing the source code repository. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlAuthInfo + """ + + _validation = { + 'source_control_type': {'required': True}, + 'repository_url': {'required': True}, + } + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'is_commit_trigger_enabled': {'key': 'isCommitTriggerEnabled', 'type': 'bool'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'SourceControlAuthInfo'}, + } + + def __init__(self, **kwargs): + super(SourceRepositoryProperties, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.is_commit_trigger_enabled = kwargs.get('is_commit_trigger_enabled', False) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py new file mode 100644 index 000000000000..787f32b41d9b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceRepositoryProperties(Model): + """The properties of the source code repository. + + All required parameters must be populated in order to send to Azure. + + :param source_control_type: Required. The type of source control service. + Possible values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlType + :param repository_url: Required. The full URL to the source code + respository + :type repository_url: str + :param is_commit_trigger_enabled: The value of this property indicates + whether the source control commit trigger is enabled or not. Default + value: False . + :type is_commit_trigger_enabled: bool + :param source_control_auth_properties: The authorization properties for + accessing the source code repository. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlAuthInfo + """ + + _validation = { + 'source_control_type': {'required': True}, + 'repository_url': {'required': True}, + } + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'is_commit_trigger_enabled': {'key': 'isCommitTriggerEnabled', 'type': 'bool'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'SourceControlAuthInfo'}, + } + + def __init__(self, *, source_control_type, repository_url: str, is_commit_trigger_enabled: bool=False, source_control_auth_properties=None, **kwargs) -> None: + super(SourceRepositoryProperties, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.is_commit_trigger_enabled = is_commit_trigger_enabled + self.source_control_auth_properties = source_control_auth_properties diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py new file mode 100644 index 000000000000..3d9a87f57c6d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceRepositoryUpdateParameters(Model): + """The properties for updating the source code repository configuration. + + :param source_control_auth_properties: The authorization properties for + accessing the source code repository. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlAuthInfo + :param is_commit_trigger_enabled: The value of this property indicates + whether the source control commit trigger is enabled or not. + :type is_commit_trigger_enabled: bool + """ + + _attribute_map = { + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'SourceControlAuthInfo'}, + 'is_commit_trigger_enabled': {'key': 'isCommitTriggerEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SourceRepositoryUpdateParameters, self).__init__(**kwargs) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + self.is_commit_trigger_enabled = kwargs.get('is_commit_trigger_enabled', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py new file mode 100644 index 000000000000..add70a5110d1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceRepositoryUpdateParameters(Model): + """The properties for updating the source code repository configuration. + + :param source_control_auth_properties: The authorization properties for + accessing the source code repository. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceControlAuthInfo + :param is_commit_trigger_enabled: The value of this property indicates + whether the source control commit trigger is enabled or not. + :type is_commit_trigger_enabled: bool + """ + + _attribute_map = { + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'SourceControlAuthInfo'}, + 'is_commit_trigger_enabled': {'key': 'isCommitTriggerEnabled', 'type': 'bool'}, + } + + def __init__(self, *, source_control_auth_properties=None, is_commit_trigger_enabled: bool=None, **kwargs) -> None: + super(SourceRepositoryUpdateParameters, self).__init__(**kwargs) + self.source_control_auth_properties = source_control_auth_properties + self.is_commit_trigger_enabled = is_commit_trigger_enabled diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py new file mode 100644 index 000000000000..381fd538e9e3 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceUploadDefinition(Model): + """The properties of a response to source upload request. + + :param upload_url: The URL where the client can upload the source. + :type upload_url: str + :param relative_path: The relative path to the source. This is used to + submit the subsequent queue build request. + :type relative_path: str + """ + + _attribute_map = { + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceUploadDefinition, self).__init__(**kwargs) + self.upload_url = kwargs.get('upload_url', None) + self.relative_path = kwargs.get('relative_path', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py new file mode 100644 index 000000000000..cff615964e11 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceUploadDefinition(Model): + """The properties of a response to source upload request. + + :param upload_url: The URL where the client can upload the source. + :type upload_url: str + :param relative_path: The relative path to the source. This is used to + submit the subsequent queue build request. + :type relative_path: str + """ + + _attribute_map = { + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + } + + def __init__(self, *, upload_url: str=None, relative_path: str=None, **kwargs) -> None: + super(SourceUploadDefinition, self).__init__(**kwargs) + self.upload_url = upload_url + self.relative_path = relative_path diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py new file mode 100644 index 000000000000..76444c500634 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Status(Model): + """The status of an Azure resource at the time the operation was called. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_status: The short label for the status. + :vartype display_status: str + :ivar message: The detailed message for the status, including alerts and + error messages. + :vartype message: str + :ivar timestamp: The timestamp when the status was changed to the current + value. + :vartype timestamp: datetime + """ + + _validation = { + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(Status, self).__init__(**kwargs) + self.display_status = None + self.message = None + self.timestamp = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py new file mode 100644 index 000000000000..1f4611c49912 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Status(Model): + """The status of an Azure resource at the time the operation was called. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_status: The short label for the status. + :vartype display_status: str + :ivar message: The detailed message for the status, including alerts and + error messages. + :vartype message: str + :ivar timestamp: The timestamp when the status was changed to the current + value. + :vartype timestamp: datetime + """ + + _validation = { + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(Status, self).__init__(**kwargs) + self.display_status = None + self.message = None + self.timestamp = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py new file mode 100644 index 000000000000..0541b7651cbd --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountProperties(Model): + """The properties of a storage account for a container registry. Only + applicable to Classic SKU. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The resource ID of the storage account. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py new file mode 100644 index 000000000000..5714fde0fcd2 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountProperties(Model): + """The properties of a storage account for a container registry. Only + applicable to Classic SKU. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The resource ID of the storage account. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(StorageAccountProperties, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py new file mode 100644 index 000000000000..a9bb2a92970d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Target(Model): + """The target of the event. + + :param media_type: The MIME type of the referenced object. + :type media_type: str + :param size: The number of bytes of the content. Same as Length field. + :type size: long + :param digest: The digest of the content, as defined by the Registry V2 + HTTP API Specification. + :type digest: str + :param length: The number of bytes of the content. Same as Size field. + :type length: long + :param repository: The repository name. + :type repository: str + :param url: The direct URL to the content. + :type url: str + :param tag: The tag name. + :type tag: str + """ + + _attribute_map = { + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'digest': {'key': 'digest', 'type': 'str'}, + 'length': {'key': 'length', 'type': 'long'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Target, self).__init__(**kwargs) + self.media_type = kwargs.get('media_type', None) + self.size = kwargs.get('size', None) + self.digest = kwargs.get('digest', None) + self.length = kwargs.get('length', None) + self.repository = kwargs.get('repository', None) + self.url = kwargs.get('url', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py new file mode 100644 index 000000000000..013f2d1bedeb --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Target(Model): + """The target of the event. + + :param media_type: The MIME type of the referenced object. + :type media_type: str + :param size: The number of bytes of the content. Same as Length field. + :type size: long + :param digest: The digest of the content, as defined by the Registry V2 + HTTP API Specification. + :type digest: str + :param length: The number of bytes of the content. Same as Size field. + :type length: long + :param repository: The repository name. + :type repository: str + :param url: The direct URL to the content. + :type url: str + :param tag: The tag name. + :type tag: str + """ + + _attribute_map = { + 'media_type': {'key': 'mediaType', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'long'}, + 'digest': {'key': 'digest', 'type': 'str'}, + 'length': {'key': 'length', 'type': 'long'}, + 'repository': {'key': 'repository', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, *, media_type: str=None, size: int=None, digest: str=None, length: int=None, repository: str=None, url: str=None, tag: str=None, **kwargs) -> None: + super(Target, self).__init__(**kwargs) + self.media_type = media_type + self.size = size + self.digest = digest + self.length = length + self.repository = repository + self.url = url + self.tag = tag diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py new file mode 100644 index 000000000000..ed9bc0383fad --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Webhook(Resource): + """An object that represents a webhook for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + :ivar provisioning_state: The provisioning state of the webhook at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'actions': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Webhook, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) + self.provisioning_state = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py new file mode 100644 index 000000000000..3a84139cd596 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookCreateParameters(Model): + """The parameters for creating a webhook. + + All required parameters must be populated in order to send to Azure. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param location: Required. The location of the webhook. This cannot be + changed after the resource is created. + :type location: str + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + """ + + _validation = { + 'location': {'required': True}, + 'service_uri': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WebhookCreateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py new file mode 100644 index 000000000000..12d16959672c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookCreateParameters(Model): + """The parameters for creating a webhook. + + All required parameters must be populated in order to send to Azure. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param location: Required. The location of the webhook. This cannot be + changed after the resource is created. + :type location: str + :param service_uri: Required. The service URI for the webhook to post + notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + """ + + _validation = { + 'location': {'required': True}, + 'service_uri': {'required': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, location: str, service_uri: str, actions, tags=None, custom_headers=None, status=None, scope: str=None, **kwargs) -> None: + super(WebhookCreateParameters, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.service_uri = service_uri + self.custom_headers = custom_headers + self.status = status + self.scope = scope + self.actions = actions diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py new file mode 100644 index 000000000000..3cd548274502 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WebhookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Webhook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Webhook]'} + } + + def __init__(self, *args, **kwargs): + + super(WebhookPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py new file mode 100644 index 000000000000..91a644e553c6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Webhook(Resource): + """An object that represents a webhook for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: Required. The list of actions that trigger the webhook to + post notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + :ivar provisioning_state: The provisioning state of the webhook at the + time the operation was called. Possible values include: 'Creating', + 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'actions': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, actions, tags=None, status=None, scope: str=None, **kwargs) -> None: + super(Webhook, self).__init__(location=location, tags=tags, **kwargs) + self.status = status + self.scope = scope + self.actions = actions + self.provisioning_state = None diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py new file mode 100644 index 000000000000..e0933cd2246b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookUpdateParameters(Model): + """The parameters for updating a webhook. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param service_uri: The service URI for the webhook to post notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: The list of actions that trigger the webhook to post + notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.service_uri = kwargs.get('service_uri', None) + self.custom_headers = kwargs.get('custom_headers', None) + self.status = kwargs.get('status', None) + self.scope = kwargs.get('scope', None) + self.actions = kwargs.get('actions', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py new file mode 100644 index 000000000000..166f06be0018 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookUpdateParameters(Model): + """The parameters for updating a webhook. + + :param tags: The tags for the webhook. + :type tags: dict[str, str] + :param service_uri: The service URI for the webhook to post notifications. + :type service_uri: str + :param custom_headers: Custom headers that will be added to the webhook + notifications. + :type custom_headers: dict[str, str] + :param status: The status of the webhook at the time the operation was + called. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookStatus + :param scope: The scope of repositories where the event can be triggered. + For example, 'foo:*' means events for all tags under repository 'foo'. + 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + 'foo:latest'. Empty means all events. + :type scope: str + :param actions: The list of actions that trigger the webhook to post + notifications. + :type actions: list[str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookAction] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_uri': {'key': 'properties.serviceUri', 'type': 'str'}, + 'custom_headers': {'key': 'properties.customHeaders', 'type': '{str}'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, service_uri: str=None, custom_headers=None, status=None, scope: str=None, actions=None, **kwargs) -> None: + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.service_uri = service_uri + self.custom_headers = custom_headers + self.status = status + self.scope = scope + self.actions = actions diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py new file mode 100644 index 000000000000..a067a22283c0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .registries_operations import RegistriesOperations +from .operations import Operations +from .replications_operations import ReplicationsOperations +from .webhooks_operations import WebhooksOperations +from .builds_operations import BuildsOperations +from .build_steps_operations import BuildStepsOperations +from .build_tasks_operations import BuildTasksOperations + +__all__ = [ + 'RegistriesOperations', + 'Operations', + 'ReplicationsOperations', + 'WebhooksOperations', + 'BuildsOperations', + 'BuildStepsOperations', + 'BuildTasksOperations', +] diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py new file mode 100644 index 000000000000..638000eb398a --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py @@ -0,0 +1,588 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BuildStepsOperations(object): + """BuildStepsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2018-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, registry_name, build_task_name, custom_headers=None, raw=False, **operation_config): + """List all the build steps for a given build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BuildStep + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BuildStepPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BuildStepPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps'} + + def get( + self, resource_group_name, registry_name, build_task_name, step_name, custom_headers=None, raw=False, **operation_config): + """Gets the build step for a build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param step_name: The name of a build step for a container registry + build task. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BuildStep or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'stepName': self._serialize.url("step_name", step_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}'} + + + def _create_initial( + self, resource_group_name, registry_name, build_task_name, step_name, properties=None, custom_headers=None, raw=False, **operation_config): + build_step_create_parameters = models.BuildStep(properties=properties) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'stepName': self._serialize.url("step_name", step_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_step_create_parameters, 'BuildStep') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildStep', response) + if response.status_code == 201: + deserialized = self._deserialize('BuildStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, build_task_name, step_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a build step for a build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param step_name: The name of a build step for a container registry + build task. + :type step_name: str + :param properties: The properties of a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BuildStep or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + step_name=step_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BuildStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, build_task_name, step_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'stepName': self._serialize.url("step_name", step_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, build_task_name, step_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a build step from the build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param step_name: The name of a build step for a container registry + build task. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + step_name=step_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}'} + + + def _update_initial( + self, resource_group_name, registry_name, build_task_name, step_name, properties=None, tags=None, custom_headers=None, raw=False, **operation_config): + build_step_update_parameters = models.BuildStepUpdateParameters(properties=properties, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'stepName': self._serialize.url("step_name", step_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_step_update_parameters, 'BuildStepUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildStep', response) + if response.status_code == 201: + deserialized = self._deserialize('BuildStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, build_task_name, step_name, properties=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a build step in a build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param step_name: The name of a build step for a container registry + build task. + :type step_name: str + :param properties: The properties for updating a build step. + :type properties: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStepPropertiesUpdateParameters + :param tags: The ARM resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BuildStep or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildStep]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + step_name=step_name, + properties=properties, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BuildStep', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}'} + + def list_build_arguments( + self, resource_group_name, registry_name, build_task_name, step_name, custom_headers=None, raw=False, **operation_config): + """List the build arguments for a step including the secret arguments. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param step_name: The name of a build step for a container registry + build task. + :type step_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BuildArgument + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgumentPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildArgument] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_build_arguments.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'stepName': self._serialize.url("step_name", step_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BuildArgumentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BuildArgumentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_build_arguments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}/listBuildArguments'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py new file mode 100644 index 000000000000..5a73ba76358e --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py @@ -0,0 +1,559 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BuildTasksOperations(object): + """BuildTasksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2018-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, registry_name, filter=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists all the build tasks for a specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param filter: The build task filter to apply on the operation. + :type filter: str + :param skip_token: $skipToken is supported on get list of build tasks, + which provides the next page in the list of tasks. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BuildTask + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BuildTaskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BuildTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks'} + + def get( + self, resource_group_name, registry_name, build_task_name, custom_headers=None, raw=False, **operation_config): + """Get the properties of a specified build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BuildTask or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'} + + + def _create_initial( + self, resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_task_create_parameters, 'BuildTask') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildTask', response) + if response.status_code == 201: + deserialized = self._deserialize('BuildTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a build task for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param build_task_create_parameters: The parameters for creating a + build task. + :type build_task_create_parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BuildTask or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + build_task_create_parameters=build_task_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BuildTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, build_task_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, build_task_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'} + + + def _update_initial( + self, resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_task_update_parameters, 'BuildTaskUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildTask', response) + if response.status_code == 201: + deserialized = self._deserialize('BuildTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a build task with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param build_task_update_parameters: The parameters for updating a + build task. + :type build_task_update_parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTaskUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BuildTask or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildTask]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_task_name=build_task_name, + build_task_update_parameters=build_task_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BuildTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'} + + def list_source_repository_properties( + self, resource_group_name, registry_name, build_task_name, custom_headers=None, raw=False, **operation_config): + """Get the source control properties for a build task. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_task_name: The name of the container registry build task. + :type build_task_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceRepositoryProperties or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceRepositoryProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_source_repository_properties.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildTaskName': self._serialize.url("build_task_name", build_task_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceRepositoryProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_source_repository_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/listSourceRepositoryProperties'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py new file mode 100644 index 000000000000..32e086d6f674 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py @@ -0,0 +1,454 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BuildsOperations(object): + """BuildsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2018-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, registry_name, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Gets all the builds for a registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param filter: The builds filter to apply on the operation. + :type filter: str + :param top: $top is supported for get list of builds, which limits the + maximum number of builds to return. + :type top: int + :param skip_token: $skipToken is supported on get list of builds, + which provides the next page in the list of builds. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Build + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BuildPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BuildPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds'} + + def get( + self, resource_group_name, registry_name, build_id, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given build. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_id: The build ID. + :type build_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Build or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildId': self._serialize.url("build_id", build_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Build', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}'} + + + def _update_initial( + self, resource_group_name, registry_name, build_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): + build_update_parameters = models.BuildUpdateParameters(is_archive_enabled=is_archive_enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildId': self._serialize.url("build_id", build_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_update_parameters, 'BuildUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Build', response) + if response.status_code == 201: + deserialized = self._deserialize('Build', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, build_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch the build properties. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_id: The build ID. + :type build_id: str + :param is_archive_enabled: The value that indicates whether archiving + is enabled or not. + :type is_archive_enabled: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Build or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_id=build_id, + is_archive_enabled=is_archive_enabled, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Build', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}'} + + def get_log_link( + self, resource_group_name, registry_name, build_id, custom_headers=None, raw=False, **operation_config): + """Gets a link to download the build logs. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_id: The build ID. + :type build_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BuildGetLogResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.BuildGetLogResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_link.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildId': self._serialize.url("build_id", build_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BuildGetLogResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/getLogLink'} + + + def _cancel_initial( + self, resource_group_name, registry_name, build_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'buildId': self._serialize.url("build_id", build_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def cancel( + self, resource_group_name, registry_name, build_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancel an existing build. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_id: The build ID. + :type build_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_id=build_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/cancel'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py new file mode 100644 index 000000000000..47a1a7b6b3a0 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Azure Container Registry REST API + operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationDefinition + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py new file mode 100644 index 000000000000..476987c733d1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py @@ -0,0 +1,990 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RegistriesOperations(object): + """RegistriesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks whether the container registry name is available for use. The + name must contain only alphanumeric characters, be globally unique, and + between 5 and 50 characters in length. + + :param name: The name of the container registry. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegistryNameStatus or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryNameStatus + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + registry_name_check_request = models.RegistryNameCheckRequest(name=name) + + api_version = "2017-10-01" + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(registry_name_check_request, 'RegistryNameCheckRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryNameStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability'} + + def get( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Registry or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} + + + def _create_initial( + self, resource_group_name, registry_name, registry, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(registry, 'Registry') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) + if response.status_code == 201: + deserialized = self._deserialize('Registry', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, registry, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param registry: The parameters for creating a container registry. + :type registry: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Registry or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry=registry, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Registry', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} + + + def _update_initial( + self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(registry_update_parameters, 'RegistryUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Registry', response) + if response.status_code == 201: + deserialized = self._deserialize('Registry', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, registry_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a container registry with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param registry_update_parameters: The parameters for updating a + container registry. + :type registry_update_parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Registry or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + registry_update_parameters=registry_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Registry', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the container registries under the specified resource group. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Registry + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the container registries under the specified subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Registry + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries'} + + def list_credentials( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the login credentials for the specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegistryListCredentialsResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_credentials.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryListCredentialsResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials'} + + def regenerate_credential( + self, resource_group_name, registry_name, name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the login credentials for the specified container + registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param name: Specifies name of the password which should be + regenerated -- password or password2. Possible values include: + 'password', 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PasswordName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegistryListCredentialsResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) + + api_version = "2017-10-01" + + # Construct URL + url = self.regenerate_credential.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_credential_parameters, 'RegenerateCredentialParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryListCredentialsResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential'} + + def list_usages( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Gets the quota usages for the specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RegistryUsageListResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryUsageListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_usages.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryUsageListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages'} + + + def _queue_build_initial( + self, resource_group_name, registry_name, build_request, custom_headers=None, raw=False, **operation_config): + api_version = "2018-02-01-preview" + + # Construct URL + url = self.queue_build.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(build_request, 'QueueBuildRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Build', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def queue_build( + self, resource_group_name, registry_name, build_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new build based on the request parameters and add it to the + build queue. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param build_request: The parameters of a build that needs to queued. + :type build_request: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QueueBuildRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Build or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Build]] + :raises: :class:`CloudError` + """ + raw_result = self._queue_build_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + build_request=build_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Build', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + queue_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild'} + + def get_build_source_upload_url( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Get the upload location for the user to be able to upload the source. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceUploadDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.SourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-02-01-preview" + + # Construct URL + url = self.get_build_source_upload_url.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceUploadDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_build_source_upload_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getBuildSourceUploadUrl'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py new file mode 100644 index 000000000000..b56be794ce86 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py @@ -0,0 +1,488 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ReplicationsOperations(object): + """ReplicationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def get( + self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified replication. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param replication_name: The name of the replication. + :type replication_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Replication or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'replicationName': self._serialize.url("replication_name", replication_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + + def _create_initial( + self, resource_group_name, registry_name, replication_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + replication = models.Replication(location=location, tags=tags) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'replicationName': self._serialize.url("replication_name", replication_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(replication, 'Replication') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Replication', response) + if response.status_code == 201: + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, replication_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a replication for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param replication_name: The name of the replication. + :type replication_name: str + :param location: The location of the resource. This cannot be changed + after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Replication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'replicationName': self._serialize.url("replication_name", replication_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, replication_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a replication from a container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param replication_name: The name of the replication. + :type replication_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + + def _update_initial( + self, resource_group_name, registry_name, replication_name, tags=None, custom_headers=None, raw=False, **operation_config): + replication_update_parameters = models.ReplicationUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'replicationName': self._serialize.url("replication_name", replication_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(replication_update_parameters, 'ReplicationUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Replication', response) + if response.status_code == 201: + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, replication_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a replication for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param replication_name: The name of the replication. + :type replication_name: str + :param tags: The tags for the replication. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Replication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + replication_name=replication_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Replication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the replications for the specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Replication + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ReplicationPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Replication] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py new file mode 100644 index 000000000000..66a56f0d2cc9 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py @@ -0,0 +1,693 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class WebhooksOperations(object): + """WebhooksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def get( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified webhook. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + + def _create_initial( + self, resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(webhook_create_parameters, 'WebhookCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a webhook for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param webhook_create_parameters: The parameters for creating a + webhook. + :type webhook_create_parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Webhook or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + webhook_create_parameters=webhook_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a webhook from a container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + + def _update_initial( + self, resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(webhook_update_parameters, 'WebhookUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a webhook with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param webhook_update_parameters: The parameters for updating a + webhook. + :type webhook_update_parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Webhook or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + webhook_name=webhook_name, + webhook_update_parameters=webhook_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the webhooks for the specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Webhook + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.WebhookPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Webhook] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks'} + + def ping( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Triggers a ping event to be sent to the webhook. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventInfo or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.ping.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EventInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + ping.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping'} + + def get_callback_config( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Gets the configuration of service URI and custom headers for the + webhook. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CallbackConfig or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.CallbackConfig + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_callback_config.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CallbackConfig', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_callback_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig'} + + def list_events( + self, resource_group_name, registry_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Lists recent events for the specified webhook. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param webhook_name: The name of the webhook. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Event + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.EventPaged[~azure.mgmt.containerregistry.v2018_02_01_preview.models.Event] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_events.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/version.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/version.py new file mode 100644 index 000000000000..53a203f32aaf --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "" +